ModelImpl implements Model { @Override public Observable<List<RepositoryDTO>> getRepoList(String name) { return apiInterface .getRepositories(name) .compose(applySchedulers()); } ModelImpl(); @Override Observable<List<RepositoryDTO>> getRepoList(String name); @Override Observable<List<BranchDTO>> getRepoBranches(String owner, String name); @Override Observable<List<ContributorDTO>> getRepoContributors(String owner, String name);  }
@Test public void testGetRepoList() { RepositoryDTO[] repositoryDTOs = testUtils.getGson().fromJson(testUtils.readString("json/repos.json"), RepositoryDTO[].class); when(apiInterface.getRepositories(TestConst.TEST_OWNER)).thenReturn(Observable.just(Arrays.asList(repositoryDTOs))); TestSubscriber<List<RepositoryDTO>> testSubscriber = new TestSubscriber<>(); model.getRepoList(TestConst.TEST_OWNER).subscribe(testSubscriber); testSubscriber.assertNoErrors(); testSubscriber.assertValueCount(1); List<RepositoryDTO> actual = testSubscriber.getOnNextEvents().get(0); assertEquals(7, actual.size()); assertEquals("Android-Rate", actual.get(0).getName()); assertEquals("andrey7mel/Android-Rate", actual.get(0).getFullName()); assertEquals(26314692, actual.get(0).getId()); }