Neal Hawman
01/18/2023, 3:22 PMTom
01/18/2023, 3:46 PMNeal Hawman
01/19/2023, 9:09 AMTom
01/19/2023, 9:21 AMnewScenarioState
attribute on the stub, calling that stub will automatically advance the scenario’s state.
Here are the relevant docs: https://wiremock.org/docs/stateful-behaviour/{
"mappings": [
{
"scenarioName": "rate-limiting",
"requiredScenarioState": "Started",
"newScenarioState": "error-1",
"request": {
"method": "GET",
"urlPath": "/something"
},
"response": {
"status": 429,
"body": "Too fast!"
}
},
{
"scenarioName": "rate-limiting",
"requiredScenarioState": "error-1",
"newScenarioState": "error-2",
"request": {
"method": "GET",
"urlPath": "/something"
},
"response": {
"status": 429,
"body": "Too fast!"
}
},
{
"scenarioName": "rate-limiting",
"requiredScenarioState": "error-2",
"newScenarioState": "success",
"request": {
"method": "GET",
"urlPath": "/something"
},
"response": {
"status": 429,
"body": "Too fast!"
}
},
{
"scenarioName": "rate-limiting",
"requiredScenarioState": "success",
"request": {
"method": "GET",
"urlPath": "/something"
},
"response": {
"status": 200,
"body": "OK"
}
}
]
}
Neal Hawman
01/19/2023, 9:32 AM