VIARequisitionPresenter extends BaseRequisitionPresenter { @Override public void updateUIAfterSubmit() { view.highLightApprovedAmount(); view.refreshRequisitionForm(rnRForm); view.setProcessButtonName(context.getResources().getString(R.string.btn_complete)); } VIARequisitionPresenter(); @Override void loadData(long formId, Date periodEndDate); void loadEmergencyData(final List<StockCard> stockCards, final Date periodEndDate); @Override void attachView(BaseView baseView); void populateAdditionalDrugsViewModels(List<RnrFormItem> addedDrugInVIAs, Date periodBegin); void deleteRnRItemFromViewModel(final RnrFormItem rnrFormItem); @Override void updateUIAfterSubmit(); @Override void updateFormUI(); @Override void submitRequisition(); boolean processRequisition(String consultationNumbers); Observable<RnRForm> getSaveFormObservable(final String consultationNumbers); String getConsultationNumbers(); void setConsultationNumbers(String consultationNumbers); void createStockCardsOrUnarchiveAndAddToFormForAdditionalRnrItems(); Observable<Void> removeRnrItem(final RnrFormItem rnrFormItem);  }
@Test public void shouldOnlyUpdateUIWhenProcessEmergencyAndDraftSignature() throws Exception { presenter = spy(presenter); RnRForm rnRForm = new RnRForm(); rnRForm.setStatus(RnRForm.STATUS.DRAFT); rnRForm.setEmergency(true); presenter.rnRForm = rnRForm; presenter.processSign("sign"); verify(presenter).updateUIAfterSubmit(); reset(presenter); presenter.processSign("sign"); verify(presenter, never()).updateUIAfterSubmit(); }