Hey everyone :wave: I'm currently trying to mock ...
# general
a
Hey everyone 👋 I'm currently trying to mock a Java Spring Boot client that communicates via SOAP (sending and receiving SOAP requests/responses), and honestly, I’m kind of confused and a bit overwhelmed 😅 If anyone has a working example or has done something similar before, I’d really appreciate if you could share it — just want to see how it’s set up and working in practice. Would help a ton 🙏 Thanks in advance!
t
Here’s a really simple test case that uses the Spring Boot -> WireMock integration library: https://github.com/wiremock/wiremock-spring-boot/blob/main/src/test/java/usecases/DefaultInstanceTest.java It’s not SOAP, but that’s just a matter of how you construct the stubs e.g.
Copy code
stubFor(post(urlPathEqualTo("/soap-endpoint"))
            .withRequestBody(equalToXml("<soap:Envelope xmlns:soap=\"<http://www.w3.org/2003/05/soap-envelope/>\"> (expected request body) </soap:Envelope>"))
            .willReturn(okXml("<soap:Envelope xmlns:soap=\"<http://www.w3.org/2003/05/soap-envelope/>\"> (response body)</soap:Envelope>")));
Spring Boot integration getting started doc here: https://wiremock.org/docs/spring-boot/
💙 1