When using embedded WireMock in an environment where Jetty 9.4.10 or newer is on the classpath, multipart request verification fails due to "missing multipart body", even though the same test case passes when jetty 9.4.10 is removed from the classpath.
The project https://github.com/mszabo-wikia/wiremock-multipart-jetty-issue contains an executable test case that demonstrates the issue with WireMock 2.20. The cause of this appears to be some refactor on Jetty side that was merged in https://github.com/eclipse/jetty.project/pull/2332 and landed in 9.4.10.
The problem is that what works for Jetty 9.2 doesn't work for Jett 9.4 and vice versa.
I'll shortly be starting to publish separate Java 7 + Jetty 9.2 and Java 8 + Jetty 9.4 JARs, with this issue fixed in the latter.
Work is on this branch if you're interested: https://github.com/tomakehurst/wiremock/tree/java-7-8-build-split-spike
Awesome, thanks for the quick response!
No worries!
If you want to get notified when this is released I suggest signing up to the mailing list. I always publish release announcements on there with change details.
Hi tomakehurst,
is there another bug concerning this topic?
I am using wiremock to simulate some RESTful-Services. Stubbing GET works fine, but I have a question concerning POST multipart.
This is my stub: stubFor(post(urlMatching(...some.kind.of.url...)).willReturn(ok()));
I don't want to filter any condition with withMultipartRequestBody etc. The mock should react to all POSTs.
A first POST-request contains a multipart with header-part "Content-Transfer-Encoding: base64" and a second POST-request doesn't contain this header part.
When running into the simulation, the first one fails (getting some kind of buffer errors) and the second one is successful.
Why are the properties of a multipart request playing a role? I don't use it in stubFor(post(urlMatching(...some.kind.of.url...)).willReturn(ok()));
Unfortunately, I need to use "Content-Transfer-Encoding: base64", because the simulated RESTful-Service needs it.
Thanks in advance,
Uwe
Have you tried using the new version shipped yesterday?
See https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/wiremock-user/d2ccElkl474
Thanks! This resolved the issue for me.
Cool, that's good to hear.
Fixed in 64012fccc130aa7d4912997a2fad6d9cbb25c0f6
Hi Tom,
you are great. The new version 2.21.0 solved all my problems, which I mentioned before.
Wiremock is the best.
Thank you so much and best regards,
Uwe
Most helpful comment
The problem is that what works for Jetty 9.2 doesn't work for Jett 9.4 and vice versa.
I'll shortly be starting to publish separate Java 7 + Jetty 9.2 and Java 8 + Jetty 9.4 JARs, with this issue fixed in the latter.
Work is on this branch if you're interested: https://github.com/tomakehurst/wiremock/tree/java-7-8-build-split-spike