UserDataSource { public Observable<Boolean> toUnFollow(String user) { return userApi.toUnFollow(user) .compose(RxJavaUtils.<Response<ResponseBody>>applySchedulers()) .compose(RxJavaUtils.checkIfSuccessCode()); } UserDataSource(GithubAuthRetrofit authRetrofit, UserService userApi, Context ctx); Observable<UserInfo> getUserInfo(String user); Observable<Boolean> login(final String userName, String password); Observable<List<UserEntity>> listFollowers(String userName, int page); Observable<List<UserEntity>> listFollowing(String user, int page); Observable<List<RepositoryInfo>> listStarredRepo(String user, int page); Observable<List<RepositoryInfo>> listStarredRepo(String user, SortType_Repo sort, int page); Observable<List<RepositoryInfo>> listWatchingRepo(String user, int page); Observable<List<RepositoryInfo>> listOwnRepo(String user, int page); Observable<List<Event>> listNews(String user, int page); Observable<SearchResult<UserEntity>> search(String keyWord, String language, SortType_User sort, int page); Observable<Boolean> signOut(); String getLoginUserName(); Observable<Boolean> toFollow(String user); Observable<Boolean> toUnFollow(String user); Observable<Boolean> checkIfFollowing(String user);  }
@Test public void toUnFollow() throws Exception { TestSubscriber<Boolean> subscriber = TestSubscriber.create(); userDataSource.toUnFollow("TellH").subscribe(subscriber); subscriber.assertValue(true); }