List<Interceptor> targetInterceptors = new ArrayList<Interceptor>();
targetInterceptors.add(targetInterceptor);
OutboundInvocationChain outboundChain = setupOutbound(sourceInterceptors);
InboundInvocationChain inboundChain = setupInbound(targetInterceptors);
Message msg = new MessageImpl();
TargetInvoker invoker = createNiceMock(TargetInvoker.class);
expect(invoker.invoke(EasyMock.eq(msg))).andReturn(msg);
replay(invoker);
assertEquals(0, sourceInterceptor.getCount());
assertEquals(0, targetInterceptor.getCount());
connector.connect(inboundChain, outboundChain);
inboundChain.setTargetInvoker(invoker);
inboundChain.prepare();
msg.setTargetInvoker(inboundChain.getTargetInvoker());
assertEquals(msg, inboundChain.getHeadInterceptor().invoke(msg));
assertEquals(1, sourceInterceptor.getCount());
assertEquals(1, targetInterceptor.getCount());
verify(invoker);
}