@Test public void shouldSaveOrderFileColumns() throws Exception { OrderFileColumn orderFileColumn = new OrderFileColumn(); List<OrderFileColumn> orderFileColumns = asList(orderFileColumn); Long userId = 1L; orderRepository.saveOrderFileColumns(orderFileColumns, userId); verify(orderMapper).deleteOrderFileColumns(); verify(orderMapper, times(1)).insertOrderFileColumn(orderFileColumn); }
public void saveOrderFileColumns(List<OrderFileColumn> orderFileColumns, Long userId) { orderMapper.deleteOrderFileColumns(); for (OrderFileColumn column : orderFileColumns) { column.setModifiedBy(userId); orderMapper.insertOrderFileColumn(column); } }
OrderRepository { public void saveOrderFileColumns(List<OrderFileColumn> orderFileColumns, Long userId) { orderMapper.deleteOrderFileColumns(); for (OrderFileColumn column : orderFileColumns) { column.setModifiedBy(userId); orderMapper.insertOrderFileColumn(column); } } }
OrderRepository { public void saveOrderFileColumns(List<OrderFileColumn> orderFileColumns, Long userId) { orderMapper.deleteOrderFileColumns(); for (OrderFileColumn column : orderFileColumns) { column.setModifiedBy(userId); orderMapper.insertOrderFileColumn(column); } }  }
OrderRepository { public void saveOrderFileColumns(List<OrderFileColumn> orderFileColumns, Long userId) { orderMapper.deleteOrderFileColumns(); for (OrderFileColumn column : orderFileColumns) { column.setModifiedBy(userId); orderMapper.insertOrderFileColumn(column); } }  void save(Order order); List<Order> getOrdersForPage(int page, int pageSize, Long userId, String rightName); List<Order> getOrdersForPage(int page, int pageSize, Long userId, String right, Long supplyDepot, Long program, Long period); Order getById(Long id); void updateStatusAndShipmentIdForOrder(String orderNumber, OrderStatus status, Long shipmentId); List<OrderFileColumn> getOrderFileTemplate(); void saveOrderFileColumns(List<OrderFileColumn> orderFileColumns, Long userId); void updateOrderStatus(Order order); OrderStatus getStatus(String orderNumber); Integer getNumberOfPages(int pageSize); Integer getNumberOfPages(int pageSize, Long supplyDepot, Long program, Long period); List<Order> searchByWarehousesAndStatuses(List<Long> facilityIds, List<OrderStatus> orderStatuses, Long programId, Long facilityId); Order getByOrderNumber(String orderNumber); }
OrderRepository { public void saveOrderFileColumns(List<OrderFileColumn> orderFileColumns, Long userId) { orderMapper.deleteOrderFileColumns(); for (OrderFileColumn column : orderFileColumns) { column.setModifiedBy(userId); orderMapper.insertOrderFileColumn(column); } }  void save(Order order); List<Order> getOrdersForPage(int page, int pageSize, Long userId, String rightName); List<Order> getOrdersForPage(int page, int pageSize, Long userId, String right, Long supplyDepot, Long program, Long period); Order getById(Long id); void updateStatusAndShipmentIdForOrder(String orderNumber, OrderStatus status, Long shipmentId); List<OrderFileColumn> getOrderFileTemplate(); void saveOrderFileColumns(List<OrderFileColumn> orderFileColumns, Long userId); void updateOrderStatus(Order order); OrderStatus getStatus(String orderNumber); Integer getNumberOfPages(int pageSize); Integer getNumberOfPages(int pageSize, Long supplyDepot, Long program, Long period); List<Order> searchByWarehousesAndStatuses(List<Long> facilityIds, List<OrderStatus> orderStatuses, Long programId, Long facilityId); Order getByOrderNumber(String orderNumber);  }