Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. @isTest
  2. static void whenStartSchedulerIsInvokedANewJobIsStarted() {
  3. List<AsyncApexJob> apexjobs = [select id, ApexClass.Name From AsyncApexJob where ApexClass.Name = :BatchMessageQueueProcessor.class.getName() ];
  4. integer nrJobsBefore = apexjobs.size();
  5. Test.startTest();
  6. MessageQueueUtils.StartScheduler();
  7. Test.stopTest();
  8. apexjobs = [select id, ApexClass.Name From AsyncApexJob where ApexClass.Name = :BatchMessageQueueProcessor.class.getName() ];
  9. integer nrJobsAfter = apexjobs.size();
  10. system.assertEquals(nrJobsBefore + 1, nrJobsAfter, 'A new job must have been created');
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement