@Test public void shouldSaveChangesWhenNewItemIsSaved() throws Exception { List<LogisticsColumn> columns = new ArrayList<>(); columns.add(new LogisticsColumn()); doNothing().when(repository).insertProgramColumn(columns.get(0)); service.saveChanges(columns); verify(repository).insertProgramColumn(columns.get(0)); }
public void saveChanges(List<LogisticsColumn> columns){ for(LogisticsColumn column : columns){ if(column.getId() == null){ repository.insertProgramColumn(column); }else{ repository.updateProgramColumn(column); } } }
VaccineColumnTemplateService { public void saveChanges(List<LogisticsColumn> columns){ for(LogisticsColumn column : columns){ if(column.getId() == null){ repository.insertProgramColumn(column); }else{ repository.updateProgramColumn(column); } } } }
VaccineColumnTemplateService { public void saveChanges(List<LogisticsColumn> columns){ for(LogisticsColumn column : columns){ if(column.getId() == null){ repository.insertProgramColumn(column); }else{ repository.updateProgramColumn(column); } } }  }
VaccineColumnTemplateService { public void saveChanges(List<LogisticsColumn> columns){ for(LogisticsColumn column : columns){ if(column.getId() == null){ repository.insertProgramColumn(column); }else{ repository.updateProgramColumn(column); } } }  ProgramColumnTemplateDTO getTemplate(Long programId); void saveChanges(List<LogisticsColumn> columns); }
VaccineColumnTemplateService { public void saveChanges(List<LogisticsColumn> columns){ for(LogisticsColumn column : columns){ if(column.getId() == null){ repository.insertProgramColumn(column); }else{ repository.updateProgramColumn(column); } } }  ProgramColumnTemplateDTO getTemplate(Long programId); void saveChanges(List<LogisticsColumn> columns);  }