CakePresenter extends BasePresenter<MainView> implements Observer<CakesResponse> { public void getCakesFromDatabase() { List<Cake> cakes = mStorage.getSavedCakes(); getView().onClearItems(); getView().onCakeLoaded(cakes); } @Inject  CakePresenter(); void getCakes(); @Override void onCompleted(); @Override void onError(Throwable e); @Override void onNext(CakesResponse cakesResponse); void getCakesFromDatabase();  }
@Test public void getCakesFromDatabase() throws Exception { presenter.getCakesFromDatabase(); verify(mView, times(1)).onClearItems(); verify(mView, times(1)).onCakeLoaded(anyList()); }