ExternalServiceTest Class

Provides methods to test an external service’s asynchronous callouts, enables sending a mock request, asserts the expected request payload, then triggers the mocked external service’s asynchronous callback response.

System

See Create Unit Testing for Asynchronous Callouts in the “Extend Salesforce with Clicks, Not Code” Help Guide.

  • ExternalServiceTest Methods

    An instance of the ExternalServiceTest method is used when the test class triggers a mocked external service’s callback response. You can access ExternalServiceTest through Test.getExternalService()

An instance of the ExternalServiceTest method is used when the test class triggers a mocked external service’s callback response. You can access ExternalServiceTest through Test.getExternalService()

The following are methods for ExternalServiceTest.

Sends the HTTP request back as an external service asynchronous response.

public System.HttpResponse sendCallback(System.HttpRequest request)

Type: System.HttpResponse