Hey, quick question about scenarios and the WireMo...
# help
n
Hey, quick question about scenarios and the WireMock State extension: Is it possible to create a scenario per context? For example, I have an endpoint /foo/{ID} and ill get responses like: 1. Response: "First" 2. Response: "Second" 3. Response: "Third" 4. Response: "First" ... And so on But I need an option to have this per ID 1. (id=1) Response "First" 2. (id=1) Response "Second" 3. (id=9) Response "First" 4. (id=1) Response "Third" 5. (id=9) Response "Second" 6. (id=1) Response "First" 7. (id=3) Response "First" ... And so on
t
Yes, you can do this by creating groups of stubs, each in a unique scenario, which have different request matching criteria to support the different ID values.
n
But then I need to know the ID before runtime?
t
Yes, you’d need to know which ID values you wanted to use to trigger which responses
You could always use templating and build a single stub containing some conditional logic in the response