I’ve posted some comments on how we might improve ...
# wiremock-java
I’ve posted some comments on how we might improve extensions in 3.x and some design options. Would appreciate thoughts on https://github.com/wiremock/wiremock/issues/1512#issuecomment-1591286748 and below comments.
👍 1
FYI @Bas Dijkstra
👀 1
Added a couple of questions. They might make sense, they might not.
adapted one of extension to this branch. Replacing the
was straight forward: https://github.com/dirkbolte/wiremock-extension-state/tree/feature/use-new-extension-model
🙌 1
for implementations of multiple events, I wonder we need a differentiation. The same listener would react on multiple events but we cannot separate the parameters per event yet.
I think you could solve this by creating separate listener classes that just implement one of the callback methods (this is why they’ve all got default empty impls).
Unless I’m misunderstanding the problem?
we could but it would require the user to register multiple extensions. So if you have one extension that should offer a similar functionality for multiple cut points, you end up registering all of them. I wonder implementing multiple listeners in one class isn't ideal, whether we shouldn't split up the interface anyhow - also from an interface segregation point of view. The extension implementer can still decide to have one class implement all of them.