### Question:
ArticleDetailPresenter extends BasePresenter<ArticleDetailContract.View> implements ArticleDetailContract.Presenter { @Override public void addCollectArticle(int articleId) { addSubscribe(mDataManager.addCollectArticle(articleId) .compose(RxUtils.rxSchedulerHelper()) .compose(RxUtils.handleCollectResult()) .subscribeWith(new BaseObserver<FeedArticleListData>(mView, WanAndroidApp.getInstance().getString(R.string.collect_fail)) { @Override public void onNext(FeedArticleListData feedArticleListData) { mView.showCollectArticleData(feedArticleListData); } })); } @Inject  ArticleDetailPresenter(DataManager dataManager); @Override boolean getAutoCacheState(); @Override boolean getNoImageState(); @Override void addCollectArticle(int articleId); @Override void cancelCollectArticle(int articleId); @Override void cancelCollectPageArticle(int articleId); @Override void shareEventPermissionVerify(RxPermissions rxPermissions);  }### Answer:
@Test public void collectFail() { CookiesManager.clearAllCookies(); mArticleDetailPresenter.addCollectArticle(0); Mockito.verify(mView).showErrorMsg(mApplication.getString(R.string.collect_fail)); Mockito.verify(mView).showError(); }
@Test public void collectSuccess() { login(); mArticleDetailPresenter.addCollectArticle(0); Mockito.verify(mView).showCollectArticleData(ArgumentMatchers.any(FeedArticleListData.class)); }