@Override public void onCreate() { super.onCreate(); graph = ObjectGraph.create(getModules().toArray()); }
@Override public void onCreate() { super.onCreate(); applicationGraph = ObjectGraph.create(getModules().toArray()); }
@Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); mApplicationGraph = ObjectGraph.create(); }
private void initGraph() { List<Object> rosieModules = getRosieModules(); List<Object> modules = new ArrayList<>(rosieModules); List<Object> applicationModules = getApplicationModules(); if (applicationModules != null) { modules.addAll(applicationModules); } graph = ObjectGraph.create(modules.toArray()); }
public static void main(String[] args) { ObjectGraph objectGraph = ObjectGraph.create(new DripCoffeeModule()); CoffeeApp coffeeApp = objectGraph.get(CoffeeApp.class); coffeeApp.run(); } }
@Test public void simpleInjectionWithUnGeneratedCode() { Entry$Point entryPoint = new Entry$Point(); ObjectGraph.create(new TestModule()).inject(entryPoint); assertThat(entryPoint.a).isEqualTo("a"); } }
@Before public void setUp() { MockitoAnnotations.initMocks(this); ObjectGraph objectGraph = ObjectGraph.create(new TestModule()); objectGraph.inject(this); reset(TestRestServiceFactory.hnRestService); reset(sessionManager); reset(favoriteManager); client = new HackerNewsClient(factory, sessionManager, favoriteManager); objectGraph.inject(client); }
@Before public void setUp() { MockitoAnnotations.initMocks(this); ObjectGraph objectGraph = ObjectGraph.create(new TestModule()); objectGraph.inject(this); reset(TestRestServiceFactory.mercuryService); client = new ReadabilityClient.Impl(cache, factory); objectGraph.inject(client); callback = mock(ReadabilityClient.Callback.class); }
@Before public void setUp() { MockitoAnnotations.initMocks(this); reset(TestRestServiceFactory.algoliaRestService); ObjectGraph objectGraph = ObjectGraph.create(new TestModule()); objectGraph.inject(this); client = new AlgoliaPopularClient(factory); objectGraph.inject(client); }
@Before public void setUp() { ObjectGraph.create(new TestModule()).inject(this); reset(TestRestServiceFactory.feedbackService); client = new FeedbackClient.Impl(factory, Schedulers.immediate()); callback = mock(FeedbackClient.Callback.class); }
@Before public void setUp() { MockitoAnnotations.initMocks(this); reset(TestRestServiceFactory.algoliaRestService); AlgoliaClient.sSortByTime = true; ObjectGraph objectGraph = ObjectGraph.create(new TestModule()); objectGraph.inject(this); client = new AlgoliaClient(factory); objectGraph.inject(client); }
@Test public void testRequest() throws Throwable { createServerApiMock(); createTestScheduler(); App.setObjectGraph(ObjectGraph.create(new MainPresenterTestModule())); MainPresenter presenter = new MainPresenter(); presenter.onCreate(null); presenter.request(FIRST_NAME + " " + LAST_NAME); MainActivity mainActivity = mock(MainActivity.class); presenter.takeView(mainActivity); testScheduler.triggerActions(); verify(serverAPIMock).getItems(FIRST_NAME, LAST_NAME); verify(mainActivity).onItems(argThat(new ArgumentMatcher<ServerAPI.Item[]>() { @Override public boolean matches(Object argument) { return ((ServerAPI.Item[])argument)[0].text.equals(TEST_TEXT); } }), anyString()); }
@Override public void onCreate() { super.onCreate(); Stetho.initializeWithDefaults(this); Timber.plant(new Timber.DebugTree()); Timber.d("onCreate"); applicationGraph = ObjectGraph.create(new AppModule(this)); }
/** * Initialize the Dagger module. Passing null or mock modules can be used for testing. * * @param module for Dagger */ public void initObjectGraph(Object module) { mObjectGraph = module != null ? ObjectGraph.create(module) : null; }
public void buildObjectGraph() { objectGraph = ObjectGraph.create( new SixpackModule() ); }
@Override public synchronized void init(ProcessingEnvironment env) { super.init(env); objectGraph = ObjectGraph.create(new AnnotatedAdapterModule(env)); objectGraph.inject(this); }
private void initDagger() { objectGraph = ObjectGraph.create(getModules().toArray()); objectGraph.inject(this); }
@Override public void onCreate() { super.onCreate(); // Creating the root object graph from our root Dagger Module ObjectGraph applicationObjectGraph = ObjectGraph.create(new AppModule(this)); ObjectGraphsHolder.getInstance().putApplicationObjectGraph(applicationObjectGraph); } }
@Override public void onCreate() { super.onCreate(); objectGraph = ObjectGraph.create(new AppModule(this)); objectGraph.inject(this); GoroService.setup(this, goro); }
@Override public void onCreate() { super.onCreate(); _instance = (MyApp) getApplicationContext(); _objectGraph = ObjectGraph.create(Modules.list(this)); inject(this); Timber.plant(new CrashReportingTree()); _initializeDefaultFont(); _refWatcher = LeakCanary.install(this); }