Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lfreeland/cc51589499ce913d3acc2a3c3463f3bb to your computer and use it in GitHub Desktop.
Save lfreeland/cc51589499ce913d3acc2a3c3463f3bb to your computer and use it in GitHub Desktop.
OCRService Test Class
@isTest
public class OCRServiceTest {
@isTest
static void runOCRRollupsTest() {
Test.enableChangeDataCapture();
Account acct = new Account(Name = 'Metillium Inc');
insert acct;
Contact c1 = new Contact(
AccountId = acct.Id,
LastName = 'Test 1'
);
insert c1;
Opportunity opp = new Opportunity(
AccountId = acct.Id,
Name = 'Deal 1',
Stagename = 'Prospecting',
CloseDate = Date.Today().addMonths(3)
);
insert opp;
OpportunityContactRole ocr = new OpportunityContactRole(
OpportunityId = opp.Id,
ContactId = c1.Id
);
insert ocr;
// Fires the OpportunityContactRoleChangeEvent Trigger
Test.getEventBus().deliver();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment