MockSyncInterceptor targetInterceptor = new MockSyncInterceptor();
List<Interceptor> targetInterceptors = new ArrayList<Interceptor>();
targetInterceptors.add(targetInterceptor);
OutboundInvocationChain outboundChain = setupSource(sourceInterceptors);
InboundInvocationChain inboundChain = setupTarget(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(outboundChain, inboundChain, invoker, false);
inboundChain.prepare();
msg.setTargetInvoker(outboundChain.getTargetInvoker());
assertEquals(msg, outboundChain.getHeadInterceptor().invoke(msg));
assertEquals(1, sourceInterceptor.getCount());
assertEquals(1, targetInterceptor.getCount());
verify(invoker);
}