Hi, I am using wiremock standalone, and in a scena...
# help
n
Hi, I am using wiremock standalone, and in a scenario there is a need to path state of a response (which i can do with
transformerParameters
option) with the same randomly generated UUID. I can generate it in a response body with
{{ randomValue type='UUID' }}
, but I am struggling to create a way to send it into two different responses. May be there is a way, how I can create a variable for the whole scenario and use it?
Will {{#assign}}{{/assign}} notation work for mappings files?
o
Hi. Sorry for the slight response delay, it's a bank holiday in the UK and parenting time for me. Will respond in 2 hours or so
👍 1
n
Do not worry, any time will be perfect!
👍 1
t
Hi @Nadia Debogori there isn’t an OOTB way to store values for use across multiple stubs/responses at the moment. You can obviously pre-generate a UUID then hard-code it into your stubs or you could build an extension to handle this for you. You might find that this extension helps with your use case: https://github.com/wiremock/wiremock-extension-state It’s still under development and only works with the very latest 3.0 beta, but its purpose is to store and retrieve state between requests so might do the trick.
n
Thanks, @Tom, I’ll read and hope that it’ll help
👍 1