Salesforce Certified Platform Developer II — Question 135
A developer is creating unit tests for code that makes SOAP web service callouts. The developer needs to insert some test data as a part of the unit tests setup.
What are three actions to enable this functionality? (Choose three.)
Answer options
- A. Surround the callout with Test.startTest(), Test.stopTest()
- B. Surround the data insertion with Test.startTest(), Test.stopTest()
- C. Implement the WebServiceMock interface
- D. Update code to call Test.setMock()
- E. Implement the HttpCalloutMock interface
Correct answer: A, C, D
Explanation
The correct actions involve surrounding the callout with Test.startTest() and Test.stopTest() to manage governor limits, implementing the WebServiceMock interface to simulate the web service response, and updating the code to call Test.setMock() to set the mock response. The other options either involve data insertion, which is not necessary for the callout, or refer to HttpCalloutMock, which is not relevant for SOAP services.