wiremock / wiremock

A tool for mocking HTTP services
https://wiremock.org/
Apache License 2.0
6.27k stars 1.42k forks source link

UX: Prevent fatal failure when passing the Webhooks classpath to the CLI args #2528

Closed oleg-nenashev closed 7 months ago

oleg-nenashev commented 9 months ago

Proposal

The webhooks extension was moved into the core and enabled by default in #2376, and after it some integration tests fail with java.lang.NoSuchMethodException: org.wiremock.webhooks.Webhooks.<init>(), for example in Docker integration tests until https://github.com/wiremock/wiremock-docker/pull/100 . It happens, because the initializer was removed.

To improve the user experiences for those who update top the recent 3.x versions, I suggest the following:

References

No response

etrandafir93 commented 8 months ago

Hello @oleg-nenashev, I can look into this one if it's still needed.

Basically we need a no-args constructor here. Will I set the final fields as null? I guess so, because, as I can see, this instance will be overridden when loading the extensions because of the common key/name webhook.

Also, for logging the warning, should I use this Notifier and add a warn() method here?

prithvitewatia commented 8 months ago

Hi @etrandafir93. I think unfortunately we were both working on the same issue. I have already raised a PR for it. I think we could use Notifier with info. However If you think that warn makes more sense you can co-author this PR and change info to warn.