This is currently not possible with dagger 2 (starting with version 2.0) without any workarounds. You can read about it here .
I suggested one workaround , but this requires changes to the production code.
In short:
- provide an extra set for
@Component (e.g. in the Android setter in the Application class) - test component should expand production component
Check out both links for more information. I hope that this issue will be considered in future versions of dagger 2.
tomrozb May 05 '15 at 16:00 2015-05-05 16:00
source share