@Test public void testLoadMoreError() throws Exception { int topicId = 0; when(mTopicDetailView.getTopicId()).thenReturn(topicId); when(mTopicDetailView.getItemOffset()).thenReturn(DataManager.PAGE_LIMIT); when(mDataManager.getTopicReplies(topicId, DataManager.PAGE_LIMIT)) .thenReturn(Single.error(mock(HttpException.class))); mPresenter.loadMoreReplies(); verify(mTopicDetailView).showLoadMoreFailed(); }
public void loadMoreReplies() { final ITopicDetailView view = getView(); Disposable disposable = mDataManager.getTopicReplies(view.getTopicId(), view.getItemOffset()) .subscribe(this::loadMoreRepliesNext, this::loadMoreRepliesError); addDisposable(disposable); }
TopicDetailPresenter extends BasePresenter<ITopicDetailView> { public void loadMoreReplies() { final ITopicDetailView view = getView(); Disposable disposable = mDataManager.getTopicReplies(view.getTopicId(), view.getItemOffset()) .subscribe(this::loadMoreRepliesNext, this::loadMoreRepliesError); addDisposable(disposable); } }
TopicDetailPresenter extends BasePresenter<ITopicDetailView> { public void loadMoreReplies() { final ITopicDetailView view = getView(); Disposable disposable = mDataManager.getTopicReplies(view.getTopicId(), view.getItemOffset()) .subscribe(this::loadMoreRepliesNext, this::loadMoreRepliesError); addDisposable(disposable); } @Inject  TopicDetailPresenter(DataManager dataManager, RxBus bus); }
TopicDetailPresenter extends BasePresenter<ITopicDetailView> { public void loadMoreReplies() { final ITopicDetailView view = getView(); Disposable disposable = mDataManager.getTopicReplies(view.getTopicId(), view.getItemOffset()) .subscribe(this::loadMoreRepliesNext, this::loadMoreRepliesError); addDisposable(disposable); } @Inject  TopicDetailPresenter(DataManager dataManager, RxBus bus); @Override void onAttach(ITopicDetailView view); void onRefresh(); void loadMoreReplies(); }
TopicDetailPresenter extends BasePresenter<ITopicDetailView> { public void loadMoreReplies() { final ITopicDetailView view = getView(); Disposable disposable = mDataManager.getTopicReplies(view.getTopicId(), view.getItemOffset()) .subscribe(this::loadMoreRepliesNext, this::loadMoreRepliesError); addDisposable(disposable); } @Inject  TopicDetailPresenter(DataManager dataManager, RxBus bus); @Override void onAttach(ITopicDetailView view); void onRefresh(); void loadMoreReplies();  }