### Question:
CollectPresenter extends BasePresenter<CollectContract.View> implements CollectContract.Presenter { @Override public void getCollectList(int page, boolean isShowError) { addSubscribe(mDataManager.getCollectList(page) .compose(RxUtils.rxSchedulerHelper()) .compose(RxUtils.handleResult()) .subscribeWith(new BaseObserver<FeedArticleListData>(mView, WanAndroidApp.getInstance().getString(R.string.failed_to_obtain_collection_data), isShowError) { @Override public void onNext(FeedArticleListData feedArticleListData) { mView.showCollectList(feedArticleListData); } })); } @Inject  CollectPresenter(DataManager dataManager); @Override void attachView(CollectContract.View view); @Override void getCollectList(int page, boolean isShowError); @Override void cancelCollectPageArticle(int position, FeedArticleData feedArticleData);  }### Answer:
@Test public void getCollectListError() { CookiesManager.clearAllCookies(); mCollectPresenter.getCollectList(0, false); Mockito.verify(mView).showErrorMsg(mApplication.getString(R.string.failed_to_obtain_collection_data)); }
@Test public void getCollectListErrorShow() { CookiesManager.clearAllCookies(); mCollectPresenter.getCollectList(0, true); Mockito.verify(mView).showErrorMsg(mApplication.getString(R.string.failed_to_obtain_collection_data)); Mockito.verify(mView).showError(); }
@Test public void getCollectListSuccess() { login(); mCollectPresenter.getCollectList(0, true); Mockito.verify(mView).showCollectList(ArgumentMatchers.any(FeedArticleListData.class)); }