RestUserRepository extends RESTBaseRepository { public Observable<StatusResponse> status(String siteUrl) { if(!siteUrl.endsWith("/")){ siteUrl = siteUrl + "/"; } RestService restService = webServiceFactory.createForUrl(siteUrl); return status(restService) .subscribeOn(ioScheduler) .observeOn(uiScheduler); } @Inject  RestUserRepository(WebServiceFactory webServiceFactory, @Named("IoScheduler") Scheduler ioScheduler, @Named("UiScheduler") Scheduler uiScheduler, UserManager userManager); Observable<SuccessResponse> login(Account account); Observable<SuccessResponse> login(String url, String username, String password); Observable<StatusResponse> status(String siteUrl); Observable<StatusResponse> status(); Observable<SuccessResponse> logout(Account account);  }
@Test public void status_returnsStatusResponse() { Observable<StatusResponse> observable = userRepository.status(URL); TestObserver<StatusResponse> subscriber = new TestObserver<>(); observable.subscribe(subscriber); subscriber.assertNoErrors(); StatusResponse statusResponse = subscriber.values().get(0); verify(webServiceFactory).createForUrl(URL); assertThat(statusResponse.stat).isEqualTo(STATUS_OK); assertThat(statusResponse.result.username).isEqualTo(GUEST_USER); }