@Test public void shouldFetchProgramTemplate() throws Exception { List<? extends Column> columns = new ArrayList<>(); doReturn(columns).when(repository).fetchRnrTemplateColumnsOrMasterColumns(1L); ProgramRnrTemplate template = service.fetchProgramTemplate(1L); verify(repository).fetchRnrTemplateColumnsOrMasterColumns(1l); assertThat(template.getColumns().size(), is(columns.size())); }
public ProgramRnrTemplate fetchProgramTemplate(Long programId) { return new ProgramRnrTemplate(programId, fetchAllRnRColumns(programId)); }
RnrTemplateService { public ProgramRnrTemplate fetchProgramTemplate(Long programId) { return new ProgramRnrTemplate(programId, fetchAllRnRColumns(programId)); } }
RnrTemplateService { public ProgramRnrTemplate fetchProgramTemplate(Long programId) { return new ProgramRnrTemplate(programId, fetchAllRnRColumns(programId)); }  }
RnrTemplateService { public ProgramRnrTemplate fetchProgramTemplate(Long programId) { return new ProgramRnrTemplate(programId, fetchAllRnRColumns(programId)); }  List<RnrColumn> fetchAllRnRColumns(Long programId); @Transactional Map<String, OpenLmisMessage> saveRnRTemplateForProgram(ProgramRnrTemplate programTemplate); List<RnrColumn> fetchColumnsForRequisition(Long programId); ProgramRnrTemplate fetchProgramTemplate(Long programId); ProgramRnrTemplate fetchProgramTemplateForRequisition(Long programId); }
RnrTemplateService { public ProgramRnrTemplate fetchProgramTemplate(Long programId) { return new ProgramRnrTemplate(programId, fetchAllRnRColumns(programId)); }  List<RnrColumn> fetchAllRnRColumns(Long programId); @Transactional Map<String, OpenLmisMessage> saveRnRTemplateForProgram(ProgramRnrTemplate programTemplate); List<RnrColumn> fetchColumnsForRequisition(Long programId); ProgramRnrTemplate fetchProgramTemplate(Long programId); ProgramRnrTemplate fetchProgramTemplateForRequisition(Long programId);  }