@Test public void testInterceptTwo() throws Exception { MessageContext messageContext = new DefaultMessageContext(getMessageFactory()); IMocksControl control = createControl(); WebServiceMessageReceiver wrappedMessageReceiver = new WebServiceMessageReceiver(){ public void receive(MessageContext messageContext) throws Exception { messageContext.setResponse(getMessageFactory().createWebServiceMessage()); } }; ClientInterceptor interceptor1 = control.createMock(ClientInterceptor.class); ClientInterceptor interceptor2 = control.createMock(ClientInterceptor.class); ClientInterceptor[] interceptors = new ClientInterceptor[]{interceptor1, interceptor2}; expect(interceptor1.handleRequest(messageContext)).andReturn(true); expect(interceptor1.handleResponse(messageContext)).andReturn(true); expect(interceptor2.handleRequest(messageContext)).andReturn(true); expect(interceptor2.handleResponse(messageContext)).andReturn(true); wrappedMessageReceiver.receive(messageContext); control.replay(); InterceptingMessageReceiver receiver = new InterceptingMessageReceiver(wrappedMessageReceiver, interceptors); receiver.receive(messageContext); control.verify(); }
public void receive(MessageContext messageContext) throws Exception { interceptingTemplate.interceptRequest(messageContext, wrappedMessageReceiver); }
InterceptingMessageReceiver implements WebServiceMessageReceiver { public void receive(MessageContext messageContext) throws Exception { interceptingTemplate.interceptRequest(messageContext, wrappedMessageReceiver); } }
InterceptingMessageReceiver implements WebServiceMessageReceiver { public void receive(MessageContext messageContext) throws Exception { interceptingTemplate.interceptRequest(messageContext, wrappedMessageReceiver); } InterceptingMessageReceiver(WebServiceMessageReceiver wrappedMessageReceiver,ClientInterceptor[] interceptors); }
InterceptingMessageReceiver implements WebServiceMessageReceiver { public void receive(MessageContext messageContext) throws Exception { interceptingTemplate.interceptRequest(messageContext, wrappedMessageReceiver); } InterceptingMessageReceiver(WebServiceMessageReceiver wrappedMessageReceiver,ClientInterceptor[] interceptors); void receive(MessageContext messageContext); }
InterceptingMessageReceiver implements WebServiceMessageReceiver { public void receive(MessageContext messageContext) throws Exception { interceptingTemplate.interceptRequest(messageContext, wrappedMessageReceiver); } InterceptingMessageReceiver(WebServiceMessageReceiver wrappedMessageReceiver,ClientInterceptor[] interceptors); void receive(MessageContext messageContext);  }