Guest User

Untitled

a guest
Jul 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public class SomeBatch implements Database.Batchable<SObject> {
  2. @TestVisible String query = 'SELECT Id FROM User WHERE ...';
  3. public Database.QueryLocator start(Database.BatchableContext context) {
  4. return Database.getQueryLocator(query);
  5. }
  6. ...
  7.  
  8. SomeBatch b = new SomeBatch();
  9. b.query = 'SELECT Id FROM User WHERE ... LIMIT 200';
  10. Test.startTest();
  11. Database.executeBatch(b);
  12. Test.stopTest();
  13. // verify results
Add Comment
Please, Sign In to add comment