@Test public void shouldGetOrderFileTemplateWithConfiguration() throws Exception { OrderConfiguration orderConfiguration = new OrderConfiguration(); List<OrderFileColumn> orderFileColumns = new ArrayList<>(); OrderFileTemplateDTO expectedOrderFileTemplateDTO = new OrderFileTemplateDTO(orderConfiguration, orderFileColumns); when(orderConfigurationRepository.getConfiguration()).thenReturn(orderConfiguration); when(orderRepository.getOrderFileTemplate()).thenReturn(orderFileColumns); OrderFileTemplateDTO actualOrderFileTemplateDTO = orderService.getOrderFileTemplateDTO(); verify(orderConfigurationRepository).getConfiguration(); verify(orderRepository).getOrderFileTemplate(); assertThat(actualOrderFileTemplateDTO, is(expectedOrderFileTemplateDTO)); }
public OrderFileTemplateDTO getOrderFileTemplateDTO() { return new OrderFileTemplateDTO(orderConfigurationRepository.getConfiguration(), orderRepository.getOrderFileTemplate()); }
OrderService { public OrderFileTemplateDTO getOrderFileTemplateDTO() { return new OrderFileTemplateDTO(orderConfigurationRepository.getConfiguration(), orderRepository.getOrderFileTemplate()); } }
OrderService { public OrderFileTemplateDTO getOrderFileTemplateDTO() { return new OrderFileTemplateDTO(orderConfigurationRepository.getConfiguration(), orderRepository.getOrderFileTemplate()); }  }
OrderService { public OrderFileTemplateDTO getOrderFileTemplateDTO() { return new OrderFileTemplateDTO(orderConfigurationRepository.getConfiguration(), orderRepository.getOrderFileTemplate()); }  @Autowired void setPageSize(@Value("${order.page.size}") String pageSize); @Transactional void convertToOrder(List<Rnr> rnrList, Long userId); List<Order> getOrdersForPage(int page, Long userId, String rightName); List<Order> getOrdersForPage(int page, Long userId, String right, Long supplyDepot, Long program, Long period); Order getOrder(Long id); void updateStatusAndShipmentIdForOrders(Set<String> orderNumbers, ShipmentFileInfo shipmentFileInfo); OrderFileTemplateDTO getOrderFileTemplateDTO(); @Transactional void saveOrderFileTemplate(OrderFileTemplateDTO orderFileTemplateDTO, Long userId); OrderNumberConfiguration getOrderNumberConfiguration(); @Transactional void updateOrderNumberConfiguration(OrderNumberConfiguration orderNumberConfiguration); Set<DateFormat> getAllDateFormats(); void updateOrderStatus(Order order); boolean isShippable(String orderNumber); Integer getNumberOfPages(); Integer getNumberOfPages(Long supplyDepot, Long program, Long period); Integer getPageSize(); List<Order> searchByStatusAndRight(Long userId, String rightName, List<OrderStatus> statuses, Long programId, Long facilityId); boolean hasStatus(String orderNumber, OrderStatus... statuses); Order getByOrderNumber(String orderNumber); }
OrderService { public OrderFileTemplateDTO getOrderFileTemplateDTO() { return new OrderFileTemplateDTO(orderConfigurationRepository.getConfiguration(), orderRepository.getOrderFileTemplate()); }  @Autowired void setPageSize(@Value("${order.page.size}") String pageSize); @Transactional void convertToOrder(List<Rnr> rnrList, Long userId); List<Order> getOrdersForPage(int page, Long userId, String rightName); List<Order> getOrdersForPage(int page, Long userId, String right, Long supplyDepot, Long program, Long period); Order getOrder(Long id); void updateStatusAndShipmentIdForOrders(Set<String> orderNumbers, ShipmentFileInfo shipmentFileInfo); OrderFileTemplateDTO getOrderFileTemplateDTO(); @Transactional void saveOrderFileTemplate(OrderFileTemplateDTO orderFileTemplateDTO, Long userId); OrderNumberConfiguration getOrderNumberConfiguration(); @Transactional void updateOrderNumberConfiguration(OrderNumberConfiguration orderNumberConfiguration); Set<DateFormat> getAllDateFormats(); void updateOrderStatus(Order order); boolean isShippable(String orderNumber); Integer getNumberOfPages(); Integer getNumberOfPages(Long supplyDepot, Long program, Long period); Integer getPageSize(); List<Order> searchByStatusAndRight(Long userId, String rightName, List<OrderStatus> statuses, Long programId, Long facilityId); boolean hasStatus(String orderNumber, OrderStatus... statuses); Order getByOrderNumber(String orderNumber); static String SUPPLY_LINE_MISSING_COMMENT; }