From 5cc579230f73cf4f78db8d6b7ea1b601f654d723 Mon Sep 17 00:00:00 2001 From: djmil Date: Thu, 7 Sep 2023 14:00:27 +0200 Subject: [PATCH] SpringBoot: test GP can not be rejected twice --- .../java/djmil/cordacheckers/cordaclient/CordaClient.java | 2 +- .../djmil/cordacheckers/cordaclient/CordaClientTest.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/djmil/cordacheckers/cordaclient/CordaClient.java b/backend/src/main/java/djmil/cordacheckers/cordaclient/CordaClient.java index 57a2eb0..1d7254a 100644 --- a/backend/src/main/java/djmil/cordacheckers/cordaclient/CordaClient.java +++ b/backend/src/main/java/djmil/cordacheckers/cordaclient/CordaClient.java @@ -202,7 +202,7 @@ public class CordaClient { for (int retry = 0; retry < 6; retry++) { // Give Corda cluster some time to process our request - TimeUnit.SECONDS.sleep(retry*retry +1); // 1 2 5 8 17 33 sec + TimeUnit.SECONDS.sleep(retry*retry +2); // 2 3 6 10 18 27 sec final ResponseEntity responce = this.restTemplate.exchange( "/flow/" diff --git a/backend/src/test/java/djmil/cordacheckers/cordaclient/CordaClientTest.java b/backend/src/test/java/djmil/cordacheckers/cordaclient/CordaClientTest.java index c04fdac..00fae11 100644 --- a/backend/src/test/java/djmil/cordacheckers/cordaclient/CordaClientTest.java +++ b/backend/src/test/java/djmil/cordacheckers/cordaclient/CordaClientTest.java @@ -110,6 +110,14 @@ public class CordaClientTest { holdingIdentityResolver.getByUsername(gpReceiver)); assertThat(findByUuid(gpListReceiver, gpUuid)).isNull(); + + // GameProposal can not be rejected twice + assertThatThrownBy(() -> { + cordaClient.gameProposalAction( + holdingIdentityResolver.getByUsername(gpSender), + gpUuid, + Action.REJECT); + }); } private GameProposal findByUuid(List gpList, UUID uuid) {