@Test public void shouldCallMapMethodFromMalariaDataReportViewModelToMalariaProgramMapper() throws InvocationTargetException, NoSuchMethodException, LMISException, IllegalAccessException { initializeImplementationReportViewModels(); malariaDataReportFormPresenter.getMalariaProgram(); verify(malariaProgramMapper, times(1)).map(any(MalariaDataReportViewModel.class), any(MalariaProgram.class)); }
public MalariaProgram getMalariaProgram() throws InvocationTargetException, NoSuchMethodException, LMISException, IllegalAccessException { MalariaDataReportViewModel reportViewModel = new MalariaDataReportViewModel( DateTime.now(), period.getBegin(), period.getEnd(), viewModels.get(0), viewModels.get(1)); return malariaProgramMapper.map(reportViewModel, malariaProgram); }
MalariaDataReportFormPresenter extends BaseReportPresenter { public MalariaProgram getMalariaProgram() throws InvocationTargetException, NoSuchMethodException, LMISException, IllegalAccessException { MalariaDataReportViewModel reportViewModel = new MalariaDataReportViewModel( DateTime.now(), period.getBegin(), period.getEnd(), viewModels.get(0), viewModels.get(1)); return malariaProgramMapper.map(reportViewModel, malariaProgram); } }
MalariaDataReportFormPresenter extends BaseReportPresenter { public MalariaProgram getMalariaProgram() throws InvocationTargetException, NoSuchMethodException, LMISException, IllegalAccessException { MalariaDataReportViewModel reportViewModel = new MalariaDataReportViewModel( DateTime.now(), period.getBegin(), period.getEnd(), viewModels.get(0), viewModels.get(1)); return malariaProgramMapper.map(reportViewModel, malariaProgram); } MalariaDataReportFormPresenter(); }
MalariaDataReportFormPresenter extends BaseReportPresenter { public MalariaProgram getMalariaProgram() throws InvocationTargetException, NoSuchMethodException, LMISException, IllegalAccessException { MalariaDataReportViewModel reportViewModel = new MalariaDataReportViewModel( DateTime.now(), period.getBegin(), period.getEnd(), viewModels.get(0), viewModels.get(1)); return malariaProgramMapper.map(reportViewModel, malariaProgram); } MalariaDataReportFormPresenter(); @Override void attachView(BaseView v); Observable<List<ImplementationReportViewModel>> getImplementationViewModelsForCurrentMalariaProgram(final Period period); MalariaProgram getMalariaProgram(); List<ImplementationReportViewModel> regenerateImplementationModels(ImplementationReportViewModel updatedViewModel); Observable<MalariaProgram> onSaveForm(final ViaReportStatus status, final String sign); @Override void deleteDraft(); @Override boolean isDraft(); boolean isSubmittedForApproval(); }
MalariaDataReportFormPresenter extends BaseReportPresenter { public MalariaProgram getMalariaProgram() throws InvocationTargetException, NoSuchMethodException, LMISException, IllegalAccessException { MalariaDataReportViewModel reportViewModel = new MalariaDataReportViewModel( DateTime.now(), period.getBegin(), period.getEnd(), viewModels.get(0), viewModels.get(1)); return malariaProgramMapper.map(reportViewModel, malariaProgram); } MalariaDataReportFormPresenter(); @Override void attachView(BaseView v); Observable<List<ImplementationReportViewModel>> getImplementationViewModelsForCurrentMalariaProgram(final Period period); MalariaProgram getMalariaProgram(); List<ImplementationReportViewModel> regenerateImplementationModels(ImplementationReportViewModel updatedViewModel); Observable<MalariaProgram> onSaveForm(final ViaReportStatus status, final String sign); @Override void deleteDraft(); @Override boolean isDraft(); boolean isSubmittedForApproval(); static final int INVALID_INDEX; }