This is currently impossible with Dagger 2 (as of v2.0.0) without some workarounds. You can read about it here.
More about possible workarounds:
-
How do you override a module/dependency in a unit test with Dagger 2.0?
-
Creating test dependencies when using Dagger2