thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Business Platforms & EA · Intermediate

Test.startTest

Test method pair (Test.startTest and Test.stopTest) that gives the code under test a fresh set of governor limits and runs async work synchronously at stopTest.

Definition

Code between startTest and stopTest gets new limits, and asynchronous jobs enqueued there (future, queueable, batch) execute when stopTest is called so results can be asserted.

Exam tip

To test async Apex, enqueue it between startTest and stopTest and assert after stopTest.

Related terms