Salesforce
PDII · Question #1
PDII Question #1: Real Exam Question with Answer & Explanation
Sign in or unlock PDII to reveal the answer and full explanation for question #1. The question stem and answer options stay visible for context.
Question
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?
Options
- AAdd Test.startTest() before and Test.setMock and Test.stopTest() after
- BAdd Test.startTest() and Test.setMock before and Test.stopTest() after
- CAdd if (!Test.isRunningTest()) around CalloutUtil.sendAccountUpdate.
- DAdd Test.startTest() before and Test.stopTest() after CalloutUtil.sendAccountUpdate.
Unlock PDII to see the answer
You've previewed enough free PDII questions. Unlock PDII for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.