Is there any way to mock a batch class for unit testing and predefine the scope passed to execute method? I am using a selector class method for Database.getQueryLocator at start method.
public class someBatchClass implements Database.Batchable<sObject>{
public Database.QueryLocator start(Database.BatchableContext BC){
return new SomeSelectorClass().someMethod();
}
public void execute(Database.BatchableContext BC, List<sObject> scope){
for(Sobject s : scope){
doSomething;
}
update scope;
}
public void finish(Database.BatchableContext BC){
}
}