MultiStaticResourceCalloutMock Class

Utility class used to specify a fake response using multiple resources for testing HTTP callouts.

System

Use the methods in this class to set the response properties for testing HTTP callouts. You can specify a resource for each endpoint.

The following are constructors for MultiStaticResourceCalloutMock.

Creates a new instance of the System.MultiStaticResourceCalloutMock class.

public MultiStaticResourceCalloutMock()

The following are methods for MultiStaticResourceCalloutMock. All are instance methods.

Sets the specified header name and value for the fake response.

public Void setHeader(String headerName, String headerValue)

Type: Void

Sets the specified static resource corresponding to the endpoint. The static resource contains the response body.

public Void setStaticResource(String endpoint, String resourceName)

Type: Void

Sets the specified HTTP status for the response.

public Void setStatus(String httpStatus)

Type: Void

Sets the specified HTTP status code for the response.

public Void setStatusCode(Integer httpStatusCode)

Type: Void