Guest User

Untitled

a guest
Jan 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. public with sharing class DividingLogic implements Queueable {
  2. public String recId;
  3.  
  4. public DividingLogic(String recId){
  5.  
  6. }
  7.  
  8. public void execute(QueueableContext segId){
  9. // calls a static method of another class
  10.  
  11. }
  12. }
  13.  
  14. public void testmethod afterInsertTest(){
  15.  
  16. // Given
  17. fflib_ApexMocks mocks = new fflib_ApexMocks();
  18. Queueable mockQueue = (Queueable)mocks.mock(DividingLogic.class);
  19.  
  20. // When
  21. // I am wondering how would I pass the QueueableContext here
  22. // How do I call the execute() method of Queueable
  23.  
  24.  
  25. // Then
  26. // I want to check whether the class was enqueued from the trigger
  27. // or called at only 1 time from the trigger.
  28. // ((Queueable)mocks.verify(mockQueue,1).execute(); ??
  29.  
  30.  
  31. }
Add Comment
Please, Sign In to add comment