Locale locale = new Locale("nl");
interceptor.setFaultStringOrReason(faultString);
interceptor.setFaultStringOrReasonLocale(locale);
interceptor.setAddValidationErrorDetail(false);
SoapMessage invalidMessage = soap11Factory.createWebServiceMessage();
InputStream inputStream = getClass().getResourceAsStream(INVALID_MESSAGE);
transformer.transform(new StreamSource(inputStream), invalidMessage.getPayloadResult());
context = new DefaultMessageContext(invalidMessage, soap11Factory);
boolean result = interceptor.handleRequest(context, null);
Assert.assertFalse("Invalid response from interceptor", result);
Assert.assertTrue("Context has no response", context.hasResponse());
SoapMessage response = (SoapMessage) context.getResponse();
Assert.assertTrue("Response has no fault", response.getSoapBody().hasFault());
Soap11Fault fault = (Soap11Fault) response.getSoapBody().getFault();
Assert.assertEquals("Invalid fault code on fault", SoapVersion.SOAP_11.getClientOrSenderFaultName(),
fault.getFaultCode());
Assert.assertEquals("Invalid fault string on fault", faultString, fault.getFaultStringOrReason());
Assert.assertEquals("Invalid fault string locale on fault", locale, fault.getFaultStringLocale());
Assert.assertNull("Detail on fault", fault.getFaultDetail());