202 Accepted when verification passes and 406 Not Acceptable (with a descriptive failure message in the response body) when it does not.
PUT /mockserver/verify
Assert that a request matching the given criteria was received a specific number of times. Returns:202 Accepted if the assertion passes, 406 Not Acceptable with a failure message if it does not.
Request fields
The request matcher describing the request to check. Supports the same fields as the
httpRequest matcher in expectations: method, path, pathParameters, queryStringParameters, headers, cookies, body. You can also match against an OpenAPI operation using specUrlOrPayload and operationId.Constraints on how many times the request must have been received. If omitted, MockServer verifies the request was received at least once.
atLeast(integer) — the minimum number of times the request must have been receivedatMost(integer) — the maximum number of times the request may have been received
Verify received at least twice
Verify received at most twice
Verify received exactly twice
Set bothatLeast and atMost to the same value:
Verify received at least once (default)
Omittimes entirely, or set only atLeast: 1:
Verify against an OpenAPI operation
Failure response
When verification fails, MockServer returns406 Not Acceptable. The response body contains a human-readable explanation of what was expected versus what was received, for example:
PUT /mockserver/verifySequence
Assert that a set of requests was received in the specified order. MockServer checks that each request in the array was received, in sequence, with no constraint on what other requests arrived between them. Returns:202 Accepted if the sequence matched, 406 Not Acceptable with a failure message if it did not.
Request fields
An ordered array of request matchers. Each element uses the same matcher fields as
httpRequest in expectations. MockServer checks that these requests were received in the order given.