MMIARequisitionFragment extends BaseReportFragment implements MMIARequisitionPresenter.MMIARequisitionView { @Override public void completeSuccess() { ToastUtil.showForLongTime(R.string.msg_mmia_submit_tip); finish(); }  @Override void onCreate(Bundle savedInstanceState); @Override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState); @Override void onViewCreated(View view, Bundle savedInstanceState); @Override void refreshRequisitionForm(RnRForm form); @NonNull Subscriber<Void> getOnSavedSubscriber(); @Override void showValidationAlert(); @Override void setProcessButtonName(String buttonName); @Override void completeSuccess(); @NonNull String getSignatureDialogTitle(); @Override void onActivityResult(int requestCode, int resultCode, Intent data); static final int REQUEST_FOR_CUSTOM_REGIME; }
@Test public void shouldSaveCompleteWhenMethodCalled() { mmiaRequisitionFragment.completeSuccess(); String successMessage = mmiaRequisitionFragment.getString(R.string.msg_mmia_submit_tip); assertThat(ShadowToast.getTextOfLatestToast()).isEqualTo(successMessage); assertThat(mmiaRequisitionFragment.getActivity().isFinishing()).isTrue(); }