diff --git a/src/test/java/ai/pluggy/client/integration/GetTransactionsTest.java b/src/test/java/ai/pluggy/client/integration/GetTransactionsTest.java index 5effc1e..7075cc8 100644 --- a/src/test/java/ai/pluggy/client/integration/GetTransactionsTest.java +++ b/src/test/java/ai/pluggy/client/integration/GetTransactionsTest.java @@ -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; @@ -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) @@ -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,