BaseRequisitionPresenter extends BaseReportPresenter { @Override public void deleteDraft() { if (!isHistoryForm()) { try { rnrFormRepository.removeRnrForm(rnRForm); } catch (LMISException e) { ToastUtil.show(context.getString(R.string.delete_rnr_form_failed_warning)); new LMISException(e, "BaseRequisitionPresenter,deleteDraft").reportToFabric(); } } } BaseRequisitionPresenter(); @Override void attachView(BaseView baseView); abstract void loadData(final long formId, Date periodEndDate); void loadAlertDialogIsFormStatusIsDraft(); RnRForm getRnrForm(long formId); void submitRequisition(); void authoriseRequisition(); @Override void deleteDraft(); void processSign(String signature); void addSignature(String signature); RnRForm.STATUS getRnrFormStatus(); boolean validateFormPeriod(); abstract void updateUIAfterSubmit(); boolean isFormProductEditable(); boolean isDraft(); boolean isDraftOrDraftMissed();  }
@Test public void shouldDeleteDraft() throws Exception { presenter.isHistoryForm = false; presenter.rnRForm = new RnRForm(); presenter.deleteDraft(); verify(mockRnrFormRepository).removeRnrForm(presenter.rnRForm); }