@SuppressWarnings("unused") @Inject void initialize(Injector injector) { injector.injectMembers(delegate); }
public void injectMembers(Object instance) { resolve().injectMembers(instance); }
@Override protected Object createTest() throws Exception { Object testObj = super.createTest(); injector.injectMembers(testObj); return testObj; } }
@Override protected Object createTest() throws Exception { Object test = super.createTest(); injector.injectMembers(test); return test; }
@BeforeClass(groups = "slow") protected void beforeClass() throws Exception { if (hasFailed()) { return; } final Injector injector = Guice.createInjector(new TestUsageModuleWithEmbeddedDB(configSource, clock)); injector.injectMembers(this); } }
@BeforeClass(groups = "slow") public void beforeClass() throws Exception { if (hasFailed()) { return; } final Injector g = Guice.createInjector(Stage.PRODUCTION, new TestDefaultSubscriptionModuleWithEmbeddedDB(configSource, clock)); g.injectMembers(this); }
@BeforeClass(groups = "fast") protected void beforeClass() throws Exception { if (hasFailed()) { return; } final Injector injector = Guice.createInjector(new TestTenantModuleNoDB(configSource, clock)); injector.injectMembers(this); } }
@BeforeClass(groups = "fast") protected void beforeClass() throws Exception { if (hasFailed()) { return; } final Injector injector = Guice.createInjector(new TestAccountModuleNoDB(configSource, clock)); injector.injectMembers(this); }
@BeforeClass(groups = "slow") protected void beforeClass() throws Exception { if (hasFailed()) { return; } final Injector injector = Guice.createInjector(new TestCatalogModuleWithEmbeddedDB(configSource, clock)); injector.injectMembers(this); }
@BeforeClass(groups = "fast") protected void beforeClass() throws Exception { if (hasFailed()) { return; } final Injector injector = Guice.createInjector(new TestOverdueModuleNoDB(configSource, clock)); injector.injectMembers(this); }
@BeforeClass(groups = "slow") protected void beforeClass() throws Exception { if (hasFailed()) { return; } final Injector injector = Guice.createInjector(new TestTenantModuleWithEmbeddedDB(configSource, clock)); injector.injectMembers(this); } }
@BeforeClass(groups = "slow") protected void beforeClass() throws Exception { if (hasFailed()) { return; } final Injector injector = Guice.createInjector(new TestAccountModuleWithEmbeddedDB(configSource, clock)); injector.injectMembers(this); }
@BeforeClass(groups = "fast") protected void beforeClass() throws Exception { if (hasFailed()) { return; } final Injector injector = Guice.createInjector(new TestUsageModuleNoDB(configSource, clock)); injector.injectMembers(this); } }
@BeforeClass(groups = "slow") protected void beforeClass() throws Exception { if (hasFailed()) { return; } final Injector injector = Guice.createInjector(new TestOverdueModuleWithEmbeddedDB(configSource, clock)); injector.injectMembers(this); }
@BeforeClass(groups = "fast") public void beforeClass() throws Exception { if (hasFailed()) { return; } final Injector g = Guice.createInjector(Stage.PRODUCTION, new TestUtilModuleNoDB(configSource, clock)); g.injectMembers(this); }
@BeforeClass(groups = "fast") protected void beforeClass() throws Exception { if (hasFailed()) { return; } final Injector injector = Guice.createInjector(new TestCatalogModuleNoDB(configSource, clock)); injector.injectMembers(this); } }
@BeforeClass(groups = "fast") public void beforeClass() throws Exception { if (hasFailed()) { return; } final Injector g = Guice.createInjector(Stage.PRODUCTION, new TestDefaultSubscriptionModuleNoDB(configSource, clock)); g.injectMembers(this); // For TestApiListener#isCompleted Mockito.doReturn(0L).when(idbi).withHandle(Mockito.<HandleCallback<Long>>any()); }
@BeforeClass(groups = "slow") public void beforeClass() throws Exception { if (hasFailed()) { return; } final Injector g = Guice.createInjector(Stage.PRODUCTION, new TestUtilModuleWithEmbeddedDB(configSource, clock)); g.injectMembers(this); Assert.assertTrue(locker.isFree("a", "b")); }
@BeforeMethod public void beforeMethod() { Module module = Modules.override(new CacheAnnotationsModule()).with(new CaffeineJCacheModule()); Guice.createInjector(module).injectMembers(this); }
@Test public void testInjection1() { properties.put(propertyPrefix + ".numBackgroundThreads", "5"); properties.put(propertyPrefix + ".populateCache", "true"); properties.put(propertyPrefix + ".useCache", "true"); properties.put(propertyPrefix + ".unCacheable", "[\"a\",\"b\"]"); configProvider.inject(properties, configurator); CacheConfig config = configProvider.get().get(); injector.injectMembers(config); Assert.assertEquals(5, config.getNumBackgroundThreads()); Assert.assertEquals(true, config.isPopulateCache()); Assert.assertEquals(true, config.isUseCache()); } @Test