Global

Type Definitions

InitOptions :Object

Properties:
Name Type Attributes Description
baseUrl string <optional>

The base URL of the mock server (eg http://wiremock:8080).

cmdDir string <optional>

The base dir to load commands from.

Source:

Command :Object

A mocking command.

Properties:
Name Type Description
type string

Either "find" or "stub".

path Array.<string>

The path the command will be available at on a session instance.

name string

The path the command will be available at on a session instance. Ignored if path is provided.

template function

A function that creates either a "find requests" criteria or a "stub mapping" definition.

Source:

WiremockStubMapping :Object

Wiremock stub mapping.

Properties:
Name Type Description
request WiremockRequestCriteria
response WiremockResponseDefinition
id string

This stub mapping's unique identifier.

uuid string

Alias for the id

name string

The stub mapping's name.

persistent boolean

Indicates that the stub mapping should be persisted immediately on create/update/delete and survive resets to default.

priority number

This stub mapping's priority relative to others. 1 is highest.

scenarioName string

The name of the scenario that this stub mapping is part of.

requiredScenarioState string

The required state of the scenario in order for this stub to be matched.

newScenarioState string

The new state for the scenario to be updated to after this stub is served.

postServeActions Object

A map of the names of post serve action extensions to trigger and their parameters.

metadata Object

Arbitrary metadata to be used for e.g. tagging, documentation. Can also be used to find and remove stubs.

Source:

WiremockResponseDefinition :Object

Only one of body, base64Body, jsonBody or bodyFileName may be specified.

Properties:
Name Type Description
status number

The HTTP status code to be returned.

statusMessage string

The HTTP status message to be returned.

headers Object

Map of response headers to send.

additionalProxyRequestHeaders Object

Extra request headers to send when proxying to another host.

body string

The response body as a string.

base64Body string

The response body as a base64 encoded string (useful for binary content).

jsonBody Object

The response body as a JSON object.

bodyFileName string

The path to the file containing the response body, relative to the configured file root.

fault string

The fault to apply (instead of a full, valid response). One of "CONNECTION_RESET_BY_PEER" "EMPTY_RESPONSE" "MALFORMED_RESPONSE_CHUNK" "RANDOM_DATA_THEN_CLOSE"

fixedDelayMilliseconds number

Number of milliseconds to delay be before sending the response.

fromConfiguredStub boolean

Read-only flag indicating false if this was the default, unmatched response. Not present otherwise.

proxyBaseUrl string

The base URL of the target to proxy matching requests to.

transformerParameters Object

Parameters to apply to response transformers.

transformers Array.<string>

List of names of transformers to apply to this response.

type string

"uniform" or "lognormal"

median number

when type lognormal

sigma number

when type lognormal

lower number

when type uniform

upper number

when type uniform

Source:

WiremockRequestCriteria :Object

Wiremock request matching criteria.

Properties:
Name Type Description
method string

The HTTP request method e.g. GET

url string

The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPath string

The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPathPattern string

The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

urlPattern string

The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.

queryParameters Object

Query parameter patterns to match against.

headers Object

Header patterns to match against.

basicAuthCredentials Object

Pre-emptive basic auth credentials to match against.

cookies Object

Cookie patterns to match against.

bodyPatterns Array.<Object>

Request body patterns to match against.

Source:

WiremockRequest :Object

Wiremock intercepted request.

Properties:
Name Type Description
url string
absoluteUrl string
method string
headers Object
body string
browserProxyRequest boolean
loggedDate number
loggedDateString string
Source: