ModelImpl implements Model { @Override public Observable<List<ContributorDTO>> getRepoContributors(String owner, String name) { return apiInterface .getContributors(owner, 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 testGetRepoContributors() { ContributorDTO[] contributorDTOs = testUtils.getGson().fromJson(testUtils.readString("json/contributors.json"), ContributorDTO[].class); when(apiInterface.getContributors(TestConst.TEST_OWNER, TestConst.TEST_REPO)).thenReturn(Observable.just(Arrays.asList(contributorDTOs))); TestSubscriber<List<ContributorDTO>> testSubscriber = new TestSubscriber<>(); model.getRepoContributors(TestConst.TEST_OWNER, TestConst.TEST_REPO).subscribe(testSubscriber); testSubscriber.assertNoErrors(); testSubscriber.assertValueCount(1); List<ContributorDTO> actual = testSubscriber.getOnNextEvents().get(0); assertEquals(11, actual.size()); assertEquals("hotchemi", actual.get(0).getLogin()); assertEquals("User", actual.get(0).getType()); assertEquals(471318, actual.get(0).getId()); }