Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SomeBatch implements Database.Batchable<SObject> {
- @TestVisible String query = 'SELECT Id FROM User WHERE ...';
- public Database.QueryLocator start(Database.BatchableContext context) {
- return Database.getQueryLocator(query);
- }
- ...
- SomeBatch b = new SomeBatch();
- b.query = 'SELECT Id FROM User WHERE ... LIMIT 200';
- Test.startTest();
- Database.executeBatch(b);
- Test.stopTest();
- // verify results
Add Comment
Please, Sign In to add comment