@Test public void shouldNotGetConsultantNumberWhenRnRFormIsNullOrInfoItemsIsNull() { presenter.rnRForm = null; assertNull(presenter.getConsultationNumbers()); RnRForm rnRForm = mock(RnRForm.class); when(rnRForm.getBaseInfoItemListWrapper()).thenReturn(new ArrayList<BaseInfoItem>()); presenter.rnRForm = rnRForm; assertNull(presenter.getConsultationNumbers()); }
public String getConsultationNumbers() { if (rnRForm != null && !rnRForm.getBaseInfoItemListWrapper().isEmpty()) { return rnRForm.getBaseInfoItemListWrapper().get(0).getValue(); } return null; }
VIARequisitionPresenter extends BaseRequisitionPresenter { public String getConsultationNumbers() { if (rnRForm != null && !rnRForm.getBaseInfoItemListWrapper().isEmpty()) { return rnRForm.getBaseInfoItemListWrapper().get(0).getValue(); } return null; } }
VIARequisitionPresenter extends BaseRequisitionPresenter { public String getConsultationNumbers() { if (rnRForm != null && !rnRForm.getBaseInfoItemListWrapper().isEmpty()) { return rnRForm.getBaseInfoItemListWrapper().get(0).getValue(); } return null; } VIARequisitionPresenter(); }
VIARequisitionPresenter extends BaseRequisitionPresenter { public String getConsultationNumbers() { if (rnRForm != null && !rnRForm.getBaseInfoItemListWrapper().isEmpty()) { return rnRForm.getBaseInfoItemListWrapper().get(0).getValue(); } return null; } 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); }
VIARequisitionPresenter extends BaseRequisitionPresenter { public String getConsultationNumbers() { if (rnRForm != null && !rnRForm.getBaseInfoItemListWrapper().isEmpty()) { return rnRForm.getBaseInfoItemListWrapper().get(0).getValue(); } return null; } 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);  }