Skip to content

Commit

Permalink
[EWT-590] Fix mandates acceptance tests (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
tl-luca-baggi authored Jun 24, 2024
1 parent ae59b84 commit 0c9c9e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<GetConfirmationOfFundsResponse> getConfirmationOfFundsResponseApiResponse = tlClient.mandates()
Expand Down Expand Up @@ -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<GetConstraintsResponse> getConstraintsResponseApiResponse = tlClient.mandates()
Expand Down Expand Up @@ -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<Void> revokeMandateResponse = tlClient.mandates()
Expand Down Expand Up @@ -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<MandateDetail> getMandateResponse = tlClient.mandates()
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0c9c9e6

Please sign in to comment.