I am trying to create dynamic mocks using WireMock. I have a situation where if I specify URL like
for this kind of request
/myManagement/v1/source?filters=myParty.id%3D%3D539%26myParty.role%3D%individual
what can I used so response will filter out the id and role and put in the response.
{
"id": "539",
"href": "http://mypartyid/539,
"name": "Employee",
"role": "Customer",
"validFor": {
"startDateTime": "2020-10-27T10:52:30.008Z"
}
}
I am using standalone wiremock jar 2.27.2 to create wiremock-server.
Since your query parameters are not separated but are sent as a single parameter, you'll need to create a custom transformer to modify the response.
Read more about transforming responses here.