I have a Spring Boot 3.3 application which has a single endpoint accepting SOAP requests.
I am using a test class annotated with @WebServiceServerTest
with an autowired MockWebServiceClient
that makes requests as follows:
client.sendRequest(withSoapEnvelope(new StringSource(soapRequest)))
.andExpect(noFault());
These requests succeed and the endpoint is called.
The problem is that I have a OncePerRequestFilter
implementation which, if the request has gzip’d, will uncompress the request and pass it through. This needs testing, and I am unsure how to go about it.
I’ve tried to use @SpringBootTest
and @AutoConfigureMockMvc
, but it means I need to craft the SOAP request and send it – which feels like it makes tests fragile.
What options are there for this type of test?