How do you override a module/dependency in a unit test with Dagger 2.0?
I have a simple Android activity with a single dependency. I inject the dependency into the activity's onCreate like this: Dagger_HelloComponent.builder() .helloModule(new HelloModule(this)) .build() .initialize(this); In my ActivityUnitTestCase I want to override the dependency with a Mockito mock. I assume I need to use a test-specific module which provides the mock, but I can't figure out how to add this module to the object graph. In Dagger 1.x this is apparently done with something like this : @Before public void setUp() { ObjectGraph.create(new TestModule()).inject(this); } What's the