Delays and faults
Two response-level behaviours let a stub misbehave on purpose: a delay holds the response back, and a fault ends the request without a usable response.
"response": { "status": 200, "body": "ok", "fixedDelayMilliseconds": 2000}Delays
| Field | Shape |
|---|---|
fixedDelayMilliseconds | integer — hold the response for exactly this long |
delayDistribution | {"type":"uniform","lower":n,"upper":n} — a random delay in that range |
"response": { "status": 200, "delayDistribution": { "type": "uniform", "lower": 100, "upper": 900 }}WireMock’s chunkedDribbleDelay is likewise not implemented.
Faults
fault takes exactly one of four values:
| Value |
|---|
EMPTY_RESPONSE |
MALFORMED_RESPONSE_CHUNK |
RANDOM_DATA_THEN_CLOSE |
CONNECTION_RESET_BY_PEER |
"response": { "fault": "CONNECTION_RESET_BY_PEER" }Related
- Writing stubs — the rest of the response fields.
- Responses — status, headers and bodies.
- Limitations — what else is deliberately not implemented.