private OutboundWire getWire(ScopeContainer scope) throws NoSuchMethodException,
InvalidServiceContractException {
ConnectorImpl connector = new ConnectorImpl();
CompositeComponent parent = EasyMock.createMock(CompositeComponent.class);
PojoConfiguration configuration = new PojoConfiguration();
configuration.setScopeContainer(scope);
configuration.setInstanceFactory(new PojoObjectFactory<TargetImpl>(TargetImpl.class.getConstructor()));
configuration.addServiceInterface(Target.class);
configuration.setParent(parent);
JavaAtomicComponent source = new JavaAtomicComponent("source", configuration, null);
OutboundWire outboundWire = createOutboundWire(new QualifiedName("target/Target"), Target.class);
outboundWire.setContainer(source);
source.addOutboundWire(outboundWire);
JavaAtomicComponent target = new JavaAtomicComponent("target", configuration, null);
InboundWire targetWire = MockFactory.createTargetWire("Target", Target.class);
targetWire.setContainer(target);
target.addInboundWire(targetWire);
InboundWire inboundWire = target.getInboundWire("Target");
inboundWire.setContainer(target);
EasyMock.expect(parent.getChild("target")).andReturn(target);
EasyMock.replay(parent);
connector.connect(source);
target.start();
return outboundWire;