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.

Namespace

SF_Archive

Usage

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

ArchiverAccessorResponse Methods

The following are methods for ArchiverAccessorResponse.

setBody(jsonBody)

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

Signature

public void setBody(String jsonBody)

Parameters

jsonBody
Type: String
The response body as JSON.

Return Value

Type: Void

setStatusCode(statusCode)

Sets the HTTP status code of the mock response.

Signature

public void setStatusCode(Integer statusCode)

Parameters

statusCode
Type: Integer
The HTTP status code to simulate.

Return Value

Type: Void

setErrorMessage(errorMessage)

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

Signature

public void setErrorMessage(String errorMessage)

Parameters

errorMessage
Type: String
The error message to simulate.

Return Value

Type: Void