use of org.folio.TestMockDataConstants.MOCK_PAYMENTS_LIST in project mod-invoice by folio-org.
the class InvoiceCancelServiceTest method setupGetTransactions.
private void setupGetTransactions(Invoice invoice) throws IOException {
TransactionCollection creditCollection = getMockAs(MOCK_CREDITS_LIST, TransactionCollection.class);
TransactionCollection encumbranceCollection = getMockAs(MOCK_ENCUMBRANCES_LIST, TransactionCollection.class);
TransactionCollection paymentCollection = getMockAs(MOCK_PAYMENTS_LIST, TransactionCollection.class);
TransactionCollection pendingPaymentCollection = getMockAs(MOCK_PENDING_PAYMENTS_LIST, TransactionCollection.class);
TransactionCollection trCollection = mergeCollections(List.of(creditCollection, encumbranceCollection, paymentCollection, pendingPaymentCollection));
String query = String.format("sourceInvoiceId==%s", invoice.getId());
RequestEntry requestEntry = new RequestEntry(TRANSACTIONS_ENDPOINT).withQuery(query).withLimit(Integer.MAX_VALUE).withOffset(0);
doReturn(completedFuture(trCollection)).when(restClient).get(argThat(re -> sameRequestEntry(requestEntry, re)), eq(requestContextMock), eq(TransactionCollection.class));
}
Aggregations