SelectPeriodPresenter extends Presenter { @NonNull protected Subscriber<List<SelectInventoryViewModel>> getSubscriber() { return new Subscriber<List<SelectInventoryViewModel>>() { @Override public void onCompleted() { view.loaded(); } @Override public void onError(Throwable e) { view.loaded(); ToastUtil.show(R.string.loading_inventory_list_failed); } @Override public void onNext(List<SelectInventoryViewModel> inventories) { view.refreshDate(inventories); } }; }  @Override void attachView(BaseView v); Observable<Constants.Program> correctDirtyObservable(Constants.Program from); void loadData(final String programCode, Period period);  }
@Test public void shouldRefreshDateAfterLoadPeriods() throws LMISException { List<SelectInventoryViewModel> inventories = Arrays.asList(new SelectInventoryViewModel(new Inventory())); selectPeriodPresenter.getSubscriber().onNext(inventories); verify(view).refreshDate(inventories); }