@Test public void testLoadSiteFailed() throws Exception { when(mDataManager.getSites()).thenReturn(Single.error(mock(HttpException.class))); mSitePresenter.loadSite(); verify(mSiteView).showLoading(); verify(mSiteView).showLoadSiteError(); }
public void loadSite() { addDisposable(mDataManager.getSites().doOnSubscribe(disposable -> getView().showLoading()) .subscribe(this::handleNext, this::handleError)); }
SitePresenter extends BasePresenter<ISiteView> { public void loadSite() { addDisposable(mDataManager.getSites().doOnSubscribe(disposable -> getView().showLoading()) .subscribe(this::handleNext, this::handleError)); } }
SitePresenter extends BasePresenter<ISiteView> { public void loadSite() { addDisposable(mDataManager.getSites().doOnSubscribe(disposable -> getView().showLoading()) .subscribe(this::handleNext, this::handleError)); } @Inject  SitePresenter(DataManager dataManager); }
SitePresenter extends BasePresenter<ISiteView> { public void loadSite() { addDisposable(mDataManager.getSites().doOnSubscribe(disposable -> getView().showLoading()) .subscribe(this::handleNext, this::handleError)); } @Inject  SitePresenter(DataManager dataManager); void loadSite(); }
SitePresenter extends BasePresenter<ISiteView> { public void loadSite() { addDisposable(mDataManager.getSites().doOnSubscribe(disposable -> getView().showLoading()) .subscribe(this::handleNext, this::handleError)); } @Inject  SitePresenter(DataManager dataManager); void loadSite();  }