Ich versuche, Wiremock (testCompile 'com.github.tomakehurst: Wiremock: 2.1.4-rc3') zu verwenden, um JUnit Tests in einer Webanwendung, die 'org.eclipse.jetty: jetty verwendet -server: 9.3.6.v20151106 'als Graddle-Abhängigkeit.Wiremock-Kompatibilität mit Jetty9
Wenn ich JUnit-Tests laufen, bekomme ich einen Fehler und wiremock 2.1.4-RC3 nicht mit jetty9 kompatibel zu sein scheint ...
[Fehler: java.lang.NoSuchMethodError: org.eclipse. jetty.server.Request.getUri() Lorg/eclipse/Anlegestelle/http/HttpURI;]
Voll Stack:
java.lang.NoSuchMethodError: org.eclipse.jetty.server.Request.getUri()Lorg/eclipse/jetty/http/HttpURI;
at com.github.tomakehurst.wiremock.servlet.WireMockHttpServletRequestAdapter.isBrowserProxyRequest(WireMockHttpServletRequestAdapter.java:219)
at com.github.tomakehurst.wiremock.verification.LoggedRequest.createFrom(LoggedRequest.java:59)
at com.github.tomakehurst.wiremock.http.AdminRequestHandler.handleRequest(AdminRequestHandler.java:40)
at com.github.tomakehurst.wiremock.http.AbstractRequestHandler.handle(AbstractRequestHandler.java:41)
at com.github.tomakehurst.wiremock.servlet.WireMockHandlerDispatchingServlet.service(WireMockHandlerDispatchingServlet.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
at org.eclipse.jetty.server.Server.handle(Server.java:517)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
at java.lang.Thread.run(Thread.java:745)
Ich hatte das gleiche Problem es ein Upgrade wiremock behoben: testCompile ('com.github.tomakehurst: wiremock: 2.5.1) – Boris