@Test public void testLoadSiteSuccessful() throws Exception { List<SiteListItem> sites = mock(ArrayList.class); when(mDataManager.getSites()).thenReturn(Single.just(sites)); mSitePresenter.loadSite(); verify(mSiteView).showLoading(); verify(mSiteView).showSites(sites); }
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();  }