EasyMock.expect(outbound.getServiceContract()).andReturn(new JavaServiceContract(Foo.class)).atLeastOnce();
List<OutboundWire> wires = new ArrayList<OutboundWire>();
wires.add(outbound);
Map<String, List<OutboundWire>> wireMap = new HashMap<String, List<OutboundWire>>();
wireMap.put("ref", wires);
CompositeComponent parent = new CompositeComponentImpl("foo", "foo", null, new ConnectorImpl(), null);
SystemAtomicComponent source = EasyMock.createMock(SystemAtomicComponent.class);
EasyMock.expect(source.getScope()).andReturn(Scope.MODULE).atLeastOnce();
EasyMock.expect(source.getName()).andReturn("source").atLeastOnce();
EasyMock.expect(source.getServiceInterfaces()).andReturn(services);
EasyMock.expect(source.getOutboundWires()).andReturn(wireMap);
source.getInboundWires();
EasyMock.expectLastCall().andReturn(Collections.emptyMap());
EasyMock.expect(source.isSystem()).andReturn(true).atLeastOnce();
EasyMock.expect(source.getParent()).andReturn(parent).atLeastOnce();
source.prepare();
EasyMock.replay(source);
EasyMock.expect(outbound.getContainer()).andReturn(source);
EasyMock.replay(outbound);
parent.register(source);
SystemAtomicComponent target = EasyMock.createMock(SystemAtomicComponent.class);
EasyMock.expect(target.getName()).andReturn("target").atLeastOnce();
EasyMock.expect(target.getServiceInterfaces()).andReturn(services);
EasyMock.expect(target.getInboundWire("bar")).andReturn(inbound).atLeastOnce();
EasyMock.expect(target.getScope()).andReturn(Scope.MODULE).atLeastOnce();
EasyMock.expect(target.getParent()).andReturn(parent).atLeastOnce();
target.getInboundWires();
EasyMock.expectLastCall().andReturn(Collections.emptyMap());
target.prepare();
target.getOutboundWires();
EasyMock.expectLastCall().andReturn(Collections.emptyMap());
EasyMock.expect(target.isSystem()).andReturn(true).atLeastOnce();
EasyMock.replay(target);
EasyMock.expect(inbound.getContainer()).andReturn(target);
EasyMock.replay(inbound);
parent.register(target);
parent.prepare();
EasyMock.verify(source);
EasyMock.verify(target);
EasyMock.verify(inbound);
EasyMock.verify(outbound);
}