ArchiverAccessorResponse Class

Represents the response returned by Archive Apex methods. In tests, use the setter methods to build a simulated response for your mock to return.

SF_Archive

In an Apex test, use setBody(), setStatusCode(), and setErrorMessage() to build a simulated response that your mock returns.

The following are methods for ArchiverAccessorResponse.

Sets the body of the mock response as a JSON string.

public void setBody(String jsonBody)

jsonBody

Type: String

The response body as JSON.

Type: Void

Sets the HTTP status code of the mock response.

public void setStatusCode(Integer statusCode)

statusCode

Type: Integer

The HTTP status code to simulate.

Type: Void

Sets the error message of the mock response, so you can test how your Apex handles a failed Archive Apex callout.

public void setErrorMessage(String errorMessage)

errorMessage

Type: String

The error message to simulate.

Type: Void