@Test public void shouldInsertRnRColumnsForAProgram() throws Exception { rnrColumns.add(new RnrColumn()); rnrColumns.add(new RnrColumn()); rnrRepository.saveProgramRnrTemplate(template); verify(programRnrColumnMapper, times(2)).insert(eq(EXISTING_PROGRAM_ID), any(RnrColumn.class)); }
public void saveProgramRnrTemplate(ProgramRnrTemplate programTemplate) { if (programRnrColumnMapper.isRnrTemplateDefined(programTemplate.getProgramId())) { updateAllProgramRnRColumns(programTemplate); } else { insertAllProgramRnRColumns(programTemplate); } }
RnrTemplateRepository { public void saveProgramRnrTemplate(ProgramRnrTemplate programTemplate) { if (programRnrColumnMapper.isRnrTemplateDefined(programTemplate.getProgramId())) { updateAllProgramRnRColumns(programTemplate); } else { insertAllProgramRnRColumns(programTemplate); } } }
RnrTemplateRepository { public void saveProgramRnrTemplate(ProgramRnrTemplate programTemplate) { if (programRnrColumnMapper.isRnrTemplateDefined(programTemplate.getProgramId())) { updateAllProgramRnRColumns(programTemplate); } else { insertAllProgramRnRColumns(programTemplate); } }  }
RnrTemplateRepository { public void saveProgramRnrTemplate(ProgramRnrTemplate programTemplate) { if (programRnrColumnMapper.isRnrTemplateDefined(programTemplate.getProgramId())) { updateAllProgramRnRColumns(programTemplate); } else { insertAllProgramRnRColumns(programTemplate); } }  void saveProgramRnrTemplate(ProgramRnrTemplate programTemplate); List<RnrColumn> fetchColumnsForRequisition(Long programId); List<RnrColumn> fetchRnrTemplateColumnsOrMasterColumns(Long programId); boolean isFormulaValidationRequired(Program program); }
RnrTemplateRepository { public void saveProgramRnrTemplate(ProgramRnrTemplate programTemplate) { if (programRnrColumnMapper.isRnrTemplateDefined(programTemplate.getProgramId())) { updateAllProgramRnRColumns(programTemplate); } else { insertAllProgramRnRColumns(programTemplate); } }  void saveProgramRnrTemplate(ProgramRnrTemplate programTemplate); List<RnrColumn> fetchColumnsForRequisition(Long programId); List<RnrColumn> fetchRnrTemplateColumnsOrMasterColumns(Long programId); boolean isFormulaValidationRequired(Program program);  }