verify(connectionMock, interceptorMock1, interceptorMock2, requestCallback, extractorMock);
}
@Test
public void testInterceptorsInterceptedCreateResponse() throws Exception {
MessageContext messageContext = new DefaultMessageContext(messageFactory);
// force creation of response
messageContext.getResponse();
ClientInterceptor interceptorMock1 = createStrictMock("interceptor1", ClientInterceptor.class);
ClientInterceptor interceptorMock2 = createStrictMock("interceptor2", ClientInterceptor.class);
template.setInterceptors(new ClientInterceptor[]{interceptorMock1, interceptorMock2});
expect(interceptorMock1.handleRequest(isA(MessageContext.class))).andReturn(false);
expect(interceptorMock1.handleResponse(isA(MessageContext.class))).andReturn(true);
interceptorMock1.afterCompletion(isA(MessageContext.class), (Exception)isNull());
WebServiceMessageCallback requestCallback = createMock(WebServiceMessageCallback.class);
requestCallback.doWithMessage(messageContext.getRequest());
WebServiceMessageExtractor extractorMock = createMock(WebServiceMessageExtractor.class);
Object extracted = new Object();
expect(extractorMock.extractData(messageContext.getResponse())).andReturn(extracted);
expect(connectionMock.hasFault()).andReturn(false);
replay(connectionMock, interceptorMock1, interceptorMock2, requestCallback, extractorMock);