I have a plugin that uses wiremock and when migrating it I run into problems with dependencies. The wiremock version managed by killbill-oss-parent is 2.27.2 (the latest non-beta version) . When I run it I get this:
java.lang.NoSuchMethodError: 'void org.eclipse.jetty.server.NetworkTrafficServerConnector.addNetworkTrafficListener(org.eclipse.jetty.io.NetworkTrafficListener)'
at com.github.tomakehurst.wiremock.jetty9.JettyHttpServer.createServerConnector(JettyHttpServer.java:342)
at com.github.tomakehurst.wiremock.jetty9.JettyHttpServer.createHttpConnector(JettyHttpServer.java:248)
at com.github.tomakehurst.wiremock.jetty9.JettyHttpServer.<init>(JettyHttpServer.java:81)
at com.github.tomakehurst.wiremock.jetty92.Jetty92HttpServer.<init>(Jetty92HttpServer.java:13)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at com.github.tomakehurst.wiremock.jetty9.JettyHttpServerFactory.buildHttpServer(JettyHttpServerFactory.java:63)
at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:77)
at com.github.tomakehurst.wiremock.junit.WireMockRule.<init>(WireMockRule.java:43)
at com.github.tomakehurst.wiremock.junit.WireMockRule.<init>(WireMockRule.java:39)
at com.github.tomakehurst.wiremock.junit.WireMockRule.<init>(WireMockRule.java:56)
at org.killbill.billing.plugin.paymentsnz.PaymentPluginApiImplTest.<init>(PaymentPluginApiImplTest.java:110)
So it looks like a mismatch between the wiremock version and the version of jetty wiremock wants to use. But I did solve this by forcing the wiremock to an earlier version (1.58) which works for me. The problem seems to be that wiremock 2.27.2 has inconsistent dependencies.
I did try a later version of wiremock (V3) but it is still in beta and it I get errors from the maven plugin that enforces minimum/maximum versions.