From 0c9c9e6c1848fc1920752fb1523ac341623ece94 Mon Sep 17 00:00:00 2001 From: Luca Baggi <74901945+tl-luca-baggi@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:52:34 +0200 Subject: [PATCH] [EWT-590] Fix mandates acceptance tests (#296) --- gradle.properties | 2 +- .../java/acceptance/MandatesAcceptanceTests.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index 8a069fe7..7e55be0e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ # Main properties group=com.truelayer archivesBaseName=truelayer-java -version=13.0.4 +version=13.0.5 # Artifacts properties sonatype_repository_url=https://s01.oss.sonatype.org/service/local/ diff --git a/src/test/java/com/truelayer/java/acceptance/MandatesAcceptanceTests.java b/src/test/java/com/truelayer/java/acceptance/MandatesAcceptanceTests.java index 0cfabf27..1a9e195c 100644 --- a/src/test/java/com/truelayer/java/acceptance/MandatesAcceptanceTests.java +++ b/src/test/java/com/truelayer/java/acceptance/MandatesAcceptanceTests.java @@ -174,7 +174,7 @@ public void itShouldGetFunds(String mandatesScope, Mandate.Type mandateType) { .getUri(); runAndAssertHeadlessResourceAuthorisation(tlClient, redirectUri, HeadlessResourceAuthorization.MANDATES); - waitForMandateToBeAuthorized(createMandateResponse.getData().getId()); + waitForMandateToBeAuthorized(tlClient, createMandateResponse.getData().getId()); // finally make a confirmation of funds request for 1 penny ApiResponse getConfirmationOfFundsResponseApiResponse = tlClient.mandates() @@ -231,7 +231,7 @@ public void itShouldGetConstraints(String mandatesScope, Mandate.Type mandateTyp .getUri(); runAndAssertHeadlessResourceAuthorisation(tlClient, redirectUri, HeadlessResourceAuthorization.MANDATES); - waitForMandateToBeAuthorized(createMandateResponse.getData().getId()); + waitForMandateToBeAuthorized(tlClient, createMandateResponse.getData().getId()); // finally make a Get constraints request ApiResponse getConstraintsResponseApiResponse = tlClient.mandates() @@ -278,7 +278,7 @@ public void itShouldCreateAndRevokeAMandate(String mandatesScope, Mandate.Type m .getUri(); runAndAssertHeadlessResourceAuthorisation(tlClient, redirectUri, HeadlessResourceAuthorization.MANDATES); - waitForMandateToBeAuthorized(createMandateResponse.getData().getId()); + waitForMandateToBeAuthorized(tlClient, createMandateResponse.getData().getId()); // revoke mandate by id ApiResponse revokeMandateResponse = tlClient.mandates() @@ -333,7 +333,7 @@ public void itShouldCreateAPaymentOnMandate(String mandatesScope, Mandate.Type m .getUri(); runAndAssertHeadlessResourceAuthorisation(tlClient, redirectUri, HeadlessResourceAuthorization.MANDATES); - waitForMandateToBeAuthorized(createMandateResponse.getData().getId()); + waitForMandateToBeAuthorized(tlClient, createMandateResponse.getData().getId()); // get mandate by id ApiResponse getMandateResponse = tlClient.mandates() @@ -483,7 +483,7 @@ private void authorizeMandate(AuthorizationFlowResponse authorizationFlowRespons assertTrue(submitProviderParamsResponse.isSuccessful()); } - private void waitForMandateToBeAuthorized(String mandateId) { + private void waitForMandateToBeAuthorized(TrueLayerClient tlClient, String mandateId) { await().with() .pollInterval(1, TimeUnit.SECONDS) .atMost(30, TimeUnit.SECONDS)