Alan Guitard
03/20/2025, 2:19 PM{
"id": "18b85be5-a24a-3d60-84fa-5ecb160fb7a3",
"name": "stations",
"request": {
"url": "/stations",
"method": "POST",
"bodyPatterns": [
{
"equalToJson": "[{\"id\":\"8768600\",\"issuer\":\"SNCF\"},{\"id\":\"8775500\",\"issuer\":\"SNCF\"},{\"id\":\"8754700\",\"issuer\":\"SNCF\"},{\"id\":\"8775100\",\"issuer\":\"SNCF\"},{\"id\":\"8775767\",\"issuer\":\"SNCF\"}]",
"ignoreArrayOrder": true,
"ignoreExtraElements": false
}
]
},
"response": {
"status": 200,
"bodyFileName": "stations-18b85be5-a24a-3d60-84fa-5ecb160fb7a3.json",
"headers": {
"Keep-Alive": "timeout=60",
"x-correlation-id": "0dcb6d6f-b31e-4e21-a662-23cbc8ecfe83",
"Date": "Mon, 17 Mar 2025 16:11:01 GMT",
"Content-Type": "application/json",
"Connection": "close"
}
},
"uuid": "18b85be5-a24a-3d60-84fa-5ecb160fb7a3",
"persistent": true,
"scenarioName": "scenario-1-stations",
"requiredScenarioState": "scenario-1-stations-2",
"insertionIndex": 1
}
Issue: When I try to match the following request, it fails with the error in the screenshot:
Request payload:
[ {
"id" : "8775500",
"issuer" : "SNCF"
}, {
"id" : "8768600",
"issuer" : "SNCF"
}, {
"id" : "8754700",
"issuer" : "SNCF"
}, {
"id" : "8775100",
"issuer" : "SNCF"
}, {
"id" : "8775767",
"issuer" : "SNCF"
} ]
π As you can see, the order is not the same but it should be ignored by ignoreArrayOrder
π If I remove scenarios informations (scnearioName
and requiredScenarioState
), it is working well. I have another stubs in the same folder (same payload, same response), which seems linked by their scenario information.
I have 2 questions in order to help me here:
β’ ignoreRepeatRequests
in record spec. Do you think it will solve my case ?
β’ Since scenario information is not really needed for it to work, is there a way to tell wiremock to not save any scenario information ?
Thank you very much for your help πAlan Guitard
03/20/2025, 2:19 PM{
"id": "aea6db3b-39a7-3d43-b89c-827b039bc27a",
"name": "stations",
"request": {
"url": "/stations",
"method": "POST",
"bodyPatterns": [
{
"equalToJson": "[{\"id\":\"8768600\",\"issuer\":\"SNCF\"},{\"id\":\"8775500\",\"issuer\":\"SNCF\"},{\"id\":\"8754700\",\"issuer\":\"SNCF\"},{\"id\":\"8775100\",\"issuer\":\"SNCF\"},{\"id\":\"8775767\",\"issuer\":\"SNCF\"}]",
"ignoreArrayOrder": true,
"ignoreExtraElements": false
}
]
},
"response": {
"status": 200,
"bodyFileName": "stations-aea6db3b-39a7-3d43-b89c-827b039bc27a.json",
"headers": {
"Keep-Alive": "timeout=60",
"x-correlation-id": "0dcb6d6f-b31e-4e21-a662-23cbc8ecfe83",
"Date": "Mon, 17 Mar 2025 16:11:01 GMT",
"Content-Type": "application/json",
"Connection": "close"
}
},
"uuid": "aea6db3b-39a7-3d43-b89c-827b039bc27a",
"persistent": true,
"scenarioName": "scenario-1-stations",
"requiredScenarioState": "Started",
"newScenarioState": "scenario-1-stations-2",
"insertionIndex": 2
}
Tom
03/20/2025, 2:30 PMrepeatsAsScenarios
or something like that.Alan Guitard
03/20/2025, 2:49 PMrepeatsAsScenarios
is set to false when calling ignoreRepeatRequests
Thanks, Tom π