You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additionally I have set up the following test class with two tests - the first one manually creating the service itself, the second one relying on transfuse injection. The first test passes, the second one fails.
Test code is like this:
Injection doesn't work in this case because Transfuse didn't process the test class. This brings up an excellent idea though, what if we had an injector you could use for this sort of case? Something like this:
I'm trying to use
@Provides
to return a Singelton of a Retrofit REST API Service.The
@Provides
code looks like this:The Retrofit Interface looks like this:
Additionally I have set up the following test class with two tests - the first one manually creating the service itself, the second one relying on transfuse injection. The first test passes, the second one fails.
Test code is like this:
Now, for the question: Why doesn't injection work in the test class?
The text was updated successfully, but these errors were encountered: