/**
* Tests wiring of an entry point directly to an external service
*/
public void testEPtoESInvocation() throws Throwable {
RuntimeContext runtime = MockFactory.registerFooBinding(MockFactory.createJavaRuntime());
PolicyBuilderRegistry registry = (PolicyBuilderRegistry) ((CompositeContext) runtime.getSystemContext().getContext(MockFactory.SYSTEM_CHILD))
.getContext(MockFactory.POLICY_BUILDER_REGISTRY).getInstance(null);
MockSyncInterceptor mockInterceptor = new MockSyncInterceptor();
MockInterceptorBuilder interceptorBuilder = new MockInterceptorBuilder(mockInterceptor, false);
registry.registerTargetBuilder(interceptorBuilder);
runtime.getRootContext().registerModelObject(MockFactory.createCompositeComponent("test.module"));
CompositeContext child = (CompositeContext) runtime.getRootContext().getContext("test.module");
child.registerModelObject(MockFactory.createModuleWithEntryPointToExternalService());
child.publish(new ModuleStart(this));
Object id = new Object();