PrepAway - Latest Free Exam Questions & Answers

The test method above calls a web service that updates an external system with Account information and sets th

The test method above calls a web service that updates an external system with Account information and sets the Account’s Integration_Updated__c checkbox to True when it completes. The test fails to execute and exits with an error: “Methods defined as TestMethod do not support Web service callouts. ”

What is the optimal way to fix this?

A. Add Test.startTest() before and Test.setMock and Test.stopTest() after CalloutUtil.sendAccountUpdate.
B. Add Test.startTest() and Test.setMock before and Test.stopTest() after CalloutUtil.sendAccountUpdate.
C. Add if (!Test.isRunningTest()) around CalloutUtil.sendAccountUpdate.

D. Add Test.startTest() before and Test.stopTest() after CalloutUtil.sendAccountUpdate.


Leave a Reply