This document discusses different types of testing for Android applications using Dagger 2, including unit tests, Android component tests, and instrumentation tests. It provides examples of setting up tests with Mockito and Robolectric. Product flavors are used to create a mock implementation for network calls. Instrumentation tests are configured using Espresso to test activities and verify intents. Dependencies, test setup, and common issues like test synchronization are also covered.
5. public final class NewsSourcesDataSource {
@Inject
public NewsSourcesDataSource(@NonNull NewsSourcesRestService service,
@NonNull @Named(RxModule.NETWORK) Scheduler networkScheduler) {
…
}
…
}
6. public final class NewsSourcesDataSource {
@Inject
public NewsSourcesDataSource(@NonNull NewsSourcesRestService service,
@NonNull @Named(RxModule.NETWORK) Scheduler networkScheduler) {
…
}
…
}
public interface NewsSourcesRestService {
@NonNull
@GET("sources")
Single<NewsSourcesResponseDto> sources();
}