public static Module linkContext(Context context) { return linkContext(context.getId(), Suppliers.ofInstance(context)); }
public static Module linkView(View view) { return linkView(view.unwrap().getId(), Suppliers.ofInstance(view)); }
public static Module linkContext(Context context) { return linkContext(context.getId(), Suppliers.ofInstance(context)); }
public static Module linkView(View view) { return linkView(view.unwrap().getId(), Suppliers.ofInstance(view)); }
public static Module linkContext(Context context) { return linkContext(context.getId(), Suppliers.ofInstance(context)); }
public static Module linkView(View view) { return linkView(view.unwrap().getId(), Suppliers.ofInstance(view)); }
@Test public void testLinkedContextBindsContextSupplier() { Injector injector = Guice.createInjector(linkContext(contextFor(IntegrationTestClient.class))); assertNotNull(injector.getExistingBinding(Key.get(CONTEXT_SUPPLIER, Names.named("IntegrationTestClient")))); }
@Test public void testLinkedViewBindsViewAndContextSuppliers() { Injector injector = Guice.createInjector(linkView(new DummyView(contextFor(IntegrationTestClient.class)))); assertNotNull(injector.getExistingBinding(Key.get(CONTEXT_SUPPLIER, Names.named("IntegrationTestClient")))); assertNotNull(injector.getExistingBinding(Key.get(VIEW_SUPPLIER, Names.named("IntegrationTestClient")))); }
@Override protected Iterable<Module> setupModules() { return ImmutableSet.of( ContextLinking.linkContext(neutronApiContext), getLoggingModule(), credentialStoreModule, getSshModule() ); }
@Override protected Iterable<Module> setupModules() { return ImmutableSet.<Module> of(ContextLinking.linkContext(neutronApiContext), getLoggingModule(), credentialStoreModule, getSshModule()); }