I have a soap endpoint that returns fault message when passing some parameters. I need to validate the fault string and pass the test when fault string is returned.
runner.soap(action -> action
.client(testClient)
.receive()
.status(HttpStatus.INTERNAL_SERVER_ERROR)
.validate("/t:soap:Fault/t:faultcode", "test"));
This above code gives me a soapfaultclientexception. I couldn't pass this test. Any idea.
Please use fault strategy=propagate on the soap client configuration. By default it uses throwException strategy. This is why you get the exception.
With propagate you should be able to verify the fault in a receive action.
Please refer to the documentation for the details.