Newer Version Available
StaticResourceCalloutMock Class
Utility class used to specify a fake response for testing
HTTP callouts.
Namespace
Usage
Use the methods in this class to set the response properties for testing HTTP callouts.
StaticResourceCalloutMock Constructors
The following are constructors for StaticResourceCalloutMock.
StaticResourceCalloutMock Methods
The following are methods for StaticResourceCalloutMock. All are instance methods.
setStaticResource(resourceName)
Sets the specified static resource, which contains the
response body.
Signature
public Void setStaticResource(String resourceName)
Parameters
- resourceName
- Type: String
Return Value
Type: Void
setStatus(httpStatus)
Sets the specified HTTP status for the response.
Signature
public Void setStatus(String httpStatus)
Parameters
- httpStatus
- Type: String
Return Value
Type: Void
setStatusCode(httpStatusCode)
Sets the specified HTTP status for the response.
Signature
public Void setStatusCode(Integer httpStatusCode)
Parameters
- httpStatusCode
- Type: Integer
Return Value
Type: Void