I have an app built with Retorift2 + Dagger2. I started to write Android UI tests using Espresso. To wait for a netwoking calls I need to register an IdlingResource. I have added dependency to OkHttp3IdlingResource.
I need to Inject a OkHttp in my test class, but as AppComponent is not in the same source directory so I can't just add
void inject(RegistrationLoginUiTest activity);
To my component.
How can I get OkHttp from the dependency graph into my test class?
Is the only way to create TestAppComponent and swap it with the AppComponent?