@Test public void shouldGetOrdersGivenPageNumberAndSize() { List<Order> expectedOrders = new ArrayList<>(); when(orderMapper.getOrders(3, 3, 1l, VIEW_ORDER)).thenReturn(expectedOrders); List<Order> orders = orderRepository.getOrdersForPage(2, 3, 1l, VIEW_ORDER); verify(orderMapper).getOrders(3, 3, 1l, VIEW_ORDER); assertThat(orders, is(expectedOrders)); }
public List<Order> getOrdersForPage(int page, int pageSize, Long userId, String rightName) { return orderMapper.getOrders(pageSize, (page - 1) * pageSize, userId, rightName); }
OrderRepository { public List<Order> getOrdersForPage(int page, int pageSize, Long userId, String rightName) { return orderMapper.getOrders(pageSize, (page - 1) * pageSize, userId, rightName); } }
OrderRepository { public List<Order> getOrdersForPage(int page, int pageSize, Long userId, String rightName) { return orderMapper.getOrders(pageSize, (page - 1) * pageSize, userId, rightName); }  }
OrderRepository { public List<Order> getOrdersForPage(int page, int pageSize, Long userId, String rightName) { return orderMapper.getOrders(pageSize, (page - 1) * pageSize, userId, rightName); }  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 List<Order> getOrdersForPage(int page, int pageSize, Long userId, String rightName) { return orderMapper.getOrders(pageSize, (page - 1) * pageSize, userId, rightName); }  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);  }