I am trying to cover line

System.enqueueJob(new AsyncCreateExportedTransaction(transactionsSer));

from test class with version 38 (class version 38), I am facing exception.

Error Message: System.AsyncException: Maximum stack depth has been reached.

When I tried this with test class with version 29 and (class version 33), The line executed without exception.

please let me know any doc/link which states the deprecation of the System.enqueueJob from the test class

  • Please also include the class definition for AsyncCreateExportedTransaction.
    – Adrian Larson
    Commented Feb 10, 2017 at 5:14

1 Answer 1


There is an issue reported in review, maybe you can upvote it.

Also refer this documentation which says-

The ID of a queueable Apex job isn’t returned in test context—System.enqueueJob returns null in a running test.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .