Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assumptions.assumeTrue;

import ai.pluggy.client.request.TransactionsSearchRequest;
import ai.pluggy.client.response.Transaction;
Expand Down Expand Up @@ -124,7 +125,7 @@ void getTransactions_byExistingAccountId_withPageFilters_ok() {
String firstAccountId = retrieveFirstAccountId(client, this.getItemsIdCreated());

// fetch first page
int pageSize = 2;
int pageSize = 1;
int firstPage = 1;
TransactionsSearchRequest firstPageParams = new TransactionsSearchRequest()
.page(firstPage)
Expand All @@ -142,10 +143,10 @@ void getTransactions_byExistingAccountId_withPageFilters_ok() {
int firstPageTxsCount = firstPageTransactions.size();
Integer allTxsCount = transactionsFirstPage.getTotal();

// expect to have more pages left
assertTrue(allTxsCount >= firstPageTxsCount,
String.format("expected total '%d' txs count to be greater than first page txs "
+ "count '%d', for account id '%s'", allTxsCount, firstPageTxsCount, firstAccountId));
// skip if the sandbox account doesn't have enough txs to paginate meaningfully
assumeTrue(allTxsCount >= 2,
String.format("skipping: need at least 2 txs to validate page 2 (got '%d') for account id '%s'",
allTxsCount, firstAccountId));

// expect first page to be complete (ie. to equal page size param)
assertEquals(firstPageTxsCount, pageSize,
Expand Down
Loading