2
votes
Accepted
Database.QueryLocator mocking during unit test
This seems like an X-Y problem to me. There should be no need to mock things here.
Assuming that you're simply trying to write a unit test for a batch class, you should generally be calling the start()...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
batch × 2048apex × 1416
schedulebatch × 252
scheduled-apex × 232
unit-test × 203
soql × 146
trigger × 131
governorlimits × 106
callout × 94
asynchronous × 61
code-coverage × 55
future × 52
visualforce × 46
class × 46
query × 37
email × 34
dml × 34
rest-api × 33
stateful × 31
exception × 29
error × 28
asyncapexjob × 26
querylocator × 26
singleemailmessage × 25
queueable-apex × 25