fabioCollini / DaggerMock

A JUnit rule to easily override Dagger 2 objects
Apache License 2.0
1.16k stars 91 forks source link

Fixes bug with newest dagger version #90

Open Frisch12 opened 5 years ago

Frisch12 commented 5 years ago

In the newest dagger version the builder is not created with methods for setting the modules but with fields for holding the modules. This fix will try to look for the method and if no method with module name is found, it will search for a field named as the module. So every combination of dagger versions is possible.

fabioCollini commented 5 years ago

Thanks for the PR! Is there an alternative way to do it and avoid using an api available only on Android 24+? The library is a java module so it shouldn't contain any android library dependency