Francis Allen
08/30/2023, 11:36 AM@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 🙂Oleg Nenashev
08/30/2023, 11:54 AMFrancis Allen
08/30/2023, 12:04 PM<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?Oleg Nenashev
08/30/2023, 12:51 PM