https://linen.dev logo
#help
Title
# help
f

Francis Allen

08/30/2023, 11:36 AM
Hola mi amigos! Does anyone have any documentation regarding the compatibility of maven dependency wiremock-jre8-standalone (or wiremock-standalone) with Java 17 and SpringBoot 3? At the moment, I’m using
@AutoConfigureWireMock(port=0)
to add a bean of WiremockConfiguration into the application context. The stubs are created with the below:
WireMock.stubFor(<http://WireMock.post|WireMock.post>(urlPathEqualsTo("/url/path")).withHeader("key", containing("value"))).withRequestBody(equalToXml("<xml-request-body>")).willReturn(aResponse().withStatus(200).withHeader("key", "value").withBody("<xml-response-body>")))
However, it seems like it’s not able to return the response body (null) despite it was able to return 200 ok status with headers. After further investigation, it seems like the configuration class of
<http://wiremock.org|wiremock.org>.custommonkey.xmlunit.jaxp13.Jaxp13XpathEngine
is unable to access the encapsulated java class of
<http://com.sun.org|com.sun.org>.apache.xpath.internal.jaxp.XPathFactoryImpl
. Any guidance or assistance on this matter would be greatly appreciated, preferably long-term fix 🙂
o

Oleg Nenashev

08/30/2023, 11:54 AM
WireMock 3 should be compatible, but not 2.x
I will update the spring boot documentation, I guess quite a lot of interest after Spring One
f

Francis Allen

08/30/2023, 12:04 PM
Hi @Oleg Nenashev Many thanks for your quick response! I have tried to use below version for wiremock-standalone:
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-standalone</artifactId>
<version>3.0.0-beta-10</version>
in combination with spring-cloud-contract-wiremock:
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-wiremock</artifactId>
<version>4.0.4</version>
Are you sure the above dependencies are fully compatible with springboot 3 & Java 17, in particular with XML body format?
o

Oleg Nenashev

08/30/2023, 12:51 PM
I need to check this version. I've used only https://github.com/maciejwalkowiak/wiremock-spring-boot recently