@Test public void shouldUpdateTemplate() { List<EDIFileColumn> shipmentFileColumns = new ArrayList<EDIFileColumn>() {{ add(new EDIFileColumn()); add(new EDIFileColumn()); add(new EDIFileColumn()); }}; EDIConfiguration shipmentConfiguration = new EDIConfiguration(); EDIFileTemplate shipmentFileTemplate = new EDIFileTemplate(shipmentConfiguration, shipmentFileColumns); service.update(shipmentFileTemplate); verify(repository).updateShipmentConfiguration(shipmentConfiguration); verify(repository, times(3)).update(any(EDIFileColumn.class)); }
@Transactional public void update(EDIFileTemplate shipmentFileTemplate) { shipmentTemplateRepository.updateShipmentConfiguration(shipmentFileTemplate.getConfiguration()); for (EDIFileColumn shipmentFileColumn : shipmentFileTemplate.getColumns()) { shipmentTemplateRepository.update(shipmentFileColumn); } }
ShipmentFileTemplateService { @Transactional public void update(EDIFileTemplate shipmentFileTemplate) { shipmentTemplateRepository.updateShipmentConfiguration(shipmentFileTemplate.getConfiguration()); for (EDIFileColumn shipmentFileColumn : shipmentFileTemplate.getColumns()) { shipmentTemplateRepository.update(shipmentFileColumn); } } }
ShipmentFileTemplateService { @Transactional public void update(EDIFileTemplate shipmentFileTemplate) { shipmentTemplateRepository.updateShipmentConfiguration(shipmentFileTemplate.getConfiguration()); for (EDIFileColumn shipmentFileColumn : shipmentFileTemplate.getColumns()) { shipmentTemplateRepository.update(shipmentFileColumn); } }  }
ShipmentFileTemplateService { @Transactional public void update(EDIFileTemplate shipmentFileTemplate) { shipmentTemplateRepository.updateShipmentConfiguration(shipmentFileTemplate.getConfiguration()); for (EDIFileColumn shipmentFileColumn : shipmentFileTemplate.getColumns()) { shipmentTemplateRepository.update(shipmentFileColumn); } }  @Transactional void update(EDIFileTemplate shipmentFileTemplate); EDIFileTemplate get(); }
ShipmentFileTemplateService { @Transactional public void update(EDIFileTemplate shipmentFileTemplate) { shipmentTemplateRepository.updateShipmentConfiguration(shipmentFileTemplate.getConfiguration()); for (EDIFileColumn shipmentFileColumn : shipmentFileTemplate.getColumns()) { shipmentTemplateRepository.update(shipmentFileColumn); } }  @Transactional void update(EDIFileTemplate shipmentFileTemplate); EDIFileTemplate get();  }