MessageContext context = new DefaultMessageContext(factory);
boolean result = resolver.resolveException(context, null, new MyCustomException());
Assert.assertTrue("resolveException returns false", result);
Assert.assertTrue("Context has no response", context.hasResponse());
SoapMessage response = (SoapMessage) context.getResponse();
Assert.assertTrue("Resonse has no fault", response.getSoapBody().hasFault());
Soap11Fault fault = (Soap11Fault) response.getSoapBody().getFault();
Assert.assertEquals("Invalid fault code on fault", new QName("http://springframework.org/spring-ws", "Fault"),
fault.getFaultCode());
Assert.assertEquals("Invalid fault string on fault", "MyCustomException thrown", fault.getFaultStringOrReason());
Assert.assertEquals("Invalid fault locale on fault", new Locale("nl"), fault.getFaultStringLocale());
}