nerdexam
Salesforce

PDII · Question #99

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…

The correct answer is A. Surround the callout with Test.startTest(), Test.stopTest() C. Implement the WebServiceMock interface D. Update code to call Test.setMock(). See the full explanation below for the reasoning.

Question

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.)

Options

  • ASurround the callout with Test.startTest(), Test.stopTest()
  • BSurround the data insertion with Test.startTest(), Test.stopTest()
  • CImplement the WebServiceMock interface
  • DUpdate code to call Test.setMock()
  • EImplement the HttpCalloutMock interface

How the community answered

(59 responses)
  • A
    81% (48)
  • B
    7% (4)
  • E
    12% (7)

Community Discussion

No community discussion yet for this question.

Full PDII Practice