QuestionQ67

Risk Identification and Mitigation

Northern Trail Outfitter’s development team has created new features for its Asia-Pacific sales team. While they test the Apex classes, the developers continually reach governor limits.

What should the architect recommend in the review to address this problem?

  • A Use test.setLimit() and test.resetLimit() methods to reset governor limits.
  • B Use test startTest() and test.stopTest() methods to reset governor limits.
  • C Use the auto reset property to automatically reset governor limits during off-hours.
  • D Use an AppExchange product which can temporarily increase the governor limits.
Explanation

Test.startTest() and Test.stopTest() isolate the code being tested in a separate governor-limit context. This prevents governor-limit consumption during test setup from reducing the limits available to the Apex code under test. Salesforce Developers: Write Tests for an Extension Provider

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!