@Test public void shouldGetShipmentTemplate() throws Exception { EDIConfiguration shipmentConfiguration = new EDIConfiguration(); List<EDIFileColumn> shipmentFileColumns = new ArrayList<>(); when(repository.getShipmentConfiguration()).thenReturn(shipmentConfiguration); when(repository.getAllShipmentFileColumns()).thenReturn(shipmentFileColumns); EDIFileTemplate shipmentFileTemplate = new EDIFileTemplate(); whenNew(EDIFileTemplate.class).withArguments(shipmentConfiguration, shipmentFileColumns).thenReturn(shipmentFileTemplate); EDIFileTemplate shipmentFileTemplateDTO = service.get(); assertThat(shipmentFileTemplateDTO, is(shipmentFileTemplate)); verify(repository).getShipmentConfiguration(); verify(repository).getAllShipmentFileColumns(); }
public EDIFileTemplate get() { EDIConfiguration config = shipmentTemplateRepository.getShipmentConfiguration(); List<EDIFileColumn> columns = shipmentTemplateRepository.getAllShipmentFileColumns(); return new EDIFileTemplate(config, columns); }
ShipmentFileTemplateService { public EDIFileTemplate get() { EDIConfiguration config = shipmentTemplateRepository.getShipmentConfiguration(); List<EDIFileColumn> columns = shipmentTemplateRepository.getAllShipmentFileColumns(); return new EDIFileTemplate(config, columns); } }
ShipmentFileTemplateService { public EDIFileTemplate get() { EDIConfiguration config = shipmentTemplateRepository.getShipmentConfiguration(); List<EDIFileColumn> columns = shipmentTemplateRepository.getAllShipmentFileColumns(); return new EDIFileTemplate(config, columns); }  }
ShipmentFileTemplateService { public EDIFileTemplate get() { EDIConfiguration config = shipmentTemplateRepository.getShipmentConfiguration(); List<EDIFileColumn> columns = shipmentTemplateRepository.getAllShipmentFileColumns(); return new EDIFileTemplate(config, columns); }  @Transactional void update(EDIFileTemplate shipmentFileTemplate); EDIFileTemplate get(); }
ShipmentFileTemplateService { public EDIFileTemplate get() { EDIConfiguration config = shipmentTemplateRepository.getShipmentConfiguration(); List<EDIFileColumn> columns = shipmentTemplateRepository.getAllShipmentFileColumns(); return new EDIFileTemplate(config, columns); }  @Transactional void update(EDIFileTemplate shipmentFileTemplate); EDIFileTemplate get();  }