MockRule
interface MockRule
A read-only view of a network mock rule.
Library-constructed: the concrete implementation is internal in :lustro. Consumers read these properties to inspect configured mocks.
Properties
Link copied to clipboard
The connection error the rule fails a matching request with, in place of a response, or null for a rule that answers with statusCode, responseHeaders, and responseBody, which a failure rule ignores.
Link copied to clipboard
The response body returned by the mock.
Link copied to clipboard
The headers returned by the mock.
Link copied to clipboard
The HTTP status code returned by the mock.
Link copied to clipboard
The URL match pattern, looked for anywhere in the request URL: as a substring, or as a regular expression when prefixed with regex:. A regular expression that must match the whole URL anchors itself with ^ and $.