This message was deleted.
# wiremock-java
s
This message was deleted.
t
Hi @Dirk Bolte, thanks for sharing this. To address your points in turn: • Response templating defaults to being local, meaning you have to activate it per stub. Did you add the
"transformers": ["response-template"]
element to your stub when you declared it? • ServeEvents already have an
id
(UUID) field, is this sufficient for what you’re trying? • You can use
ExtensionFactory
for exactly this purpose, and be able to inject core WireMock services while you’re doing it. Alternatively you can have one class that implements all the extension interfaces you need to support.
d
Is the event Id the same for the whole request? Then it would work. Will make use the extension factory, thx
ExtensionFactory works like a charm. Adaption is pushed
🎉 1
t
Yes, the ServeEvent is created at the start of request processing and is carried through to the end
So the ID is consistent
👍 1
d
@Tom is it possible to extend the
RequestMatcherExtension
to also get the
ServeEvent
so that I can access the ID?
t
Was going to start looking at this in more detail in my next batch of changes. In principle yes, but I’ll let you know when I’ve actually attempted it.
👍 1
If you just need the ID you might be able to cheat a bit for now by making a request filter that adds it as a request header
d
as background: I want to add counter matchers to state to be able to simulate different behavior on first or second call. I'm about to add one for state updates already but for request matchers, I need an identifier prevent multiple records for the same request