fabioCollini / DaggerMock

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

Cannot replace objects which is not created in a module #62

Closed sborphukon closed 6 years ago

sborphukon commented 6 years ago

Hi, I am using your lib is there any way to replace objects which was not created in a module but is directly injected through constructors.

https://stackoverflow.com/questions/39612311/android-test-with-dagger-mock-inject-constructor/47477980#47477980

fabioCollini commented 6 years ago

Hi, DaggerMock creates a module subclass to replace production objects. So I am sorry but it's not possible to replace objects created outside a module.