EasyMock.expect(targetWire.getInvocationChains()).andReturn(inboundChains);
targetWire.getSourceCallbackInvocationChains("source");
EasyMock.expectLastCall().andReturn(Collections.emptyMap());
// create the target
AtomicComponent target = EasyMock.createMock(AtomicComponent.class);
EasyMock.expect(target.getScope()).andReturn(Scope.MODULE);
target.getInboundWire(EasyMock.eq("FooService"));
EasyMock.expectLastCall().andReturn(targetWire);
target.createTargetInvoker(EasyMock.eq("FooService"), EasyMock.eq(operation));
EasyMock.expectLastCall().andReturn(null);
EasyMock.replay(target);
EasyMock.expect(targetWire.getContainer()).andReturn(target);
EasyMock.replay(targetWire);
// create the parent composite
CompositeComponent parent = EasyMock.createMock(CompositeComponent.class);
EasyMock.expect(parent.getChild("target")).andReturn(target);
EasyMock.replay(parent);
// create the outbound wire and chain from the source component
OutboundInvocationChain outboundChain = EasyMock.createMock(OutboundInvocationChain.class);
EasyMock.expect(outboundChain.getOperation()).andReturn(operation).atLeastOnce();
outboundChain.setTargetInterceptor(EasyMock.isA(SynchronousBridgingInterceptor.class));
outboundChain.setTargetInvoker(null);
outboundChain.prepare();
EasyMock.replay(outboundChain);
Map<Operation<?>, OutboundInvocationChain> outboundChains =
new HashMap<Operation<?>, OutboundInvocationChain>();
outboundChains.put(operation, outboundChain);
OutboundWire outboundWire = EasyMock.createMock(OutboundWire.class);
EasyMock.expect(outboundWire.getServiceContract()).andReturn(contract).anyTimes();
EasyMock.expect(outboundWire.getTargetName()).andReturn(new QualifiedName("target/FooService")).anyTimes();
EasyMock.expect(outboundWire.getInvocationChains()).andReturn(outboundChains).anyTimes();
outboundWire.getTargetCallbackInvocationChains();
EasyMock.expectLastCall().andReturn(Collections.emptyMap());
Map<String, List<OutboundWire>> outboundWires = new HashMap<String, List<OutboundWire>>();
List<OutboundWire> list = new ArrayList<OutboundWire>();
list.add(outboundWire);
outboundWires.put("fooService", list);
// create the source
AtomicComponent source = EasyMock.createMock(AtomicComponent.class);
EasyMock.expect(source.isSystem()).andReturn(false).atLeastOnce();
EasyMock.expect(source.getScope()).andReturn(Scope.MODULE);
EasyMock.expect(source.getParent()).andReturn(parent).atLeastOnce();
EasyMock.expect(source.getOutboundWires()).andReturn(outboundWires);
EasyMock.expect(source.getName()).andReturn("source");
source.getInboundWires();
EasyMock.expectLastCall().andReturn(Collections.emptyMap());
EasyMock.replay(source);
EasyMock.expect(outboundWire.getContainer()).andReturn(source);
EasyMock.replay(outboundWire);