Newer Version Available
ApexTestQueueItem
This object is available in API version 23.0 and later.
Supported Calls
create(), describeSObjects(), query(), retrieve(), update(), upsert()
Special Access Rules
The enableApexTestReqViewSetup field on the ApexSettings metadata type controls the activation of the critical update “Require View Setup permission to access Apex test data”. In API version 49.0 and later, when the field is set to true, users must have the View Setup and Configuration permission to access this object.
Fields
| Field Name | Description |
|---|---|
| ApexClassId |
|
| ExtendedStatus |
|
| ParentJobId |
|
| ShouldSkipCodeCoverage |
|
| Status |
|
| TestRunResultId |
|
Usage
Insert an ApexTestQueueItem object to place its corresponding Apex class in the Apex job queue for execution. The Apex job executes the test methods in the class.
To abort a class that is in the Apex job queue, perform an update operation on the ApexTestQueueItem object and set its Status field to Aborted.
If you insert multiple Apex test queue items in a single bulk operation, the queue items share the same parent job. This means that a test run can consist of the execution of the tests of several classes if all the test queue items are inserted in the same bulk operation.