verify(strategyMock);
}
@Test
public void testFaultTo() throws Exception {
SaajSoapMessage valid = loadSaajMessage(getTestPath() + "/request-fault-to.xml");
MessageContext context = new DefaultMessageContext(valid, new SaajSoapMessageFactory(messageFactory));
SaajSoapMessage response = (SaajSoapMessage) context.getResponse();
response.getSoapBody().addServerOrReceiverFault("Error", Locale.ENGLISH);
URI messageId = new URI("uid:1234");
expect(strategyMock.newMessageId((SoapMessage) context.getResponse())).andReturn(messageId);
replay(strategyMock);
boolean result = interceptor.handleFault(context, null);
assertTrue("Request with anonymous FaultTo not handled", result);
SaajSoapMessage expectedResponse = loadSaajMessage(getTestPath() + "/response-fault-to.xml");
assertXMLEqual("Invalid response for message with invalid MAP", expectedResponse,
(SaajSoapMessage) context.getResponse());
verify(strategyMock);
}