Skip to content

API_MockFactory.MockResponse

Class

apex
global class API_MockFactory.MockResponse

Represents a mock HTTP response with fault simulation options.

Since: 1.0


Fields

FieldDescription
global String bodyThe response body content (supports {{request.field}} interpolation).
global Map headersResponse headers as key-value pairs.
global String statusThe HTTP status text (e.g., "OK", "Internal Server Error").
global Integer statusCodeThe HTTP status code.

Field Details

body

apex
global String body

Type: String

The response body content (supports {{request.field}} interpolation).

Since: 1.0

headers

apex
global Map<String, String> headers

Type: Map

Response headers as key-value pairs.

Since: 1.0

status

apex
global String status

Type: String

The HTTP status text (e.g., "OK", "Internal Server Error").

Since: 1.0

statusCode

apex
global Integer statusCode

Type: Integer

The HTTP status code.

Since: 1.0