vinod p
03/21/2024, 12:36 PM{
"request": {
"method": "POST",
"urlPattern": {{url_match_pattern}}
},
"response": {
"status": 200,
"headers": {
"Content-Type": "application/json",
"request-id" : "{{#assign 'ID'}}{{randomValue type='UUID'}}{{/assign}}{{ID}}"
},
"jsonBody": {
"request_id": "{{ID}}"
}
}
}
vinod p
03/21/2024, 12:41 PMport: 8080
enable-browser-proxying: false
disable-banner: false
no-request-journal: false
verbose: true
extensions: response-template,webhook
vinod p
03/21/2024, 1:26 PMvinod p
03/21/2024, 1:26 PMLee Turner
03/21/2024, 3:40 PMvinod p
03/21/2024, 3:41 PMvinod p
03/21/2024, 3:41 PMDirk Bolte
03/21/2024, 4:12 PMrequest_id
line in there, they will be executed in isolation. If you want to use the same ID mutiple times, you need to built a whole JSON with handlebars (different use case, but maybe it transports the idea: https://github.com/wiremock/wiremock-state-extension/blob/develop/src/test/resourc[…]mplateHelperProviderExtensionTest/list_with_filled_default.json ) .Dirk Bolte
03/21/2024, 4:13 PMgithub.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer#transform
, the model for headers gets the response body passed in, so you can access it there.vinod p
03/21/2024, 5:57 PMvinod p
03/21/2024, 5:58 PMDirk Bolte
03/21/2024, 6:00 PMDirk Bolte
03/21/2024, 6:04 PMDirk Bolte
03/21/2024, 6:06 PM