use of org.folio.rest.acq.model.orders.PurchaseOrderCollection in project mod-invoice by folio-org.
the class InvoiceCancelServiceTest method setupOrderQuery.
private void setupOrderQuery(List<PurchaseOrder> orders) {
List<String> orderIds = orders.stream().map(PurchaseOrder::getId).collect(toList());
List<PurchaseOrder> openOrders = List.of(orders.get(1));
String orderIdsQuery = String.join(" or ", orderIds);
String orderQuery = "workflowStatus==\"Open\" AND id==(" + orderIdsQuery + ")";
PurchaseOrderCollection orderCollection = new PurchaseOrderCollection().withPurchaseOrders(openOrders).withTotalRecords(openOrders.size());
RequestEntry requestEntry = new RequestEntry("/orders/composite-orders").withQuery(orderQuery).withOffset(0).withLimit(Integer.MAX_VALUE);
doReturn(completedFuture(orderCollection)).when(restClient).get(argThat(re -> sameRequestEntry(requestEntry, re)), eq(requestContextMock), eq(PurchaseOrderCollection.class));
}
Aggregations