From e3f45c449a4c38dcf37837e0d58da69829b07aeb Mon Sep 17 00:00:00 2001 From: Andrew Moores Date: Mon, 6 Jan 2025 16:41:25 +0000 Subject: [PATCH] AUT-3691: Update MfaResetAuthorizeHandlerIntegrationTest to fix the issue that caused the 30 second delay to the Txma message being available to read from the SQS queue. --- .../api/MfaResetAuthorizeHandlerIntegrationTest.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/integration-tests/src/test/java/uk/gov/di/authentication/api/MfaResetAuthorizeHandlerIntegrationTest.java b/integration-tests/src/test/java/uk/gov/di/authentication/api/MfaResetAuthorizeHandlerIntegrationTest.java index f84e919bfd..46b60165a3 100644 --- a/integration-tests/src/test/java/uk/gov/di/authentication/api/MfaResetAuthorizeHandlerIntegrationTest.java +++ b/integration-tests/src/test/java/uk/gov/di/authentication/api/MfaResetAuthorizeHandlerIntegrationTest.java @@ -9,7 +9,6 @@ import com.nimbusds.jose.jwk.RSAKey; import com.nimbusds.jwt.SignedJWT; import com.nimbusds.oauth2.sdk.id.Subject; -import org.awaitility.Awaitility; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -36,7 +35,6 @@ import java.security.KeyPairGenerator; import java.security.NoSuchAlgorithmException; import java.text.ParseException; -import java.time.Duration; import java.util.Arrays; import java.util.Base64; import java.util.Map; @@ -153,7 +151,6 @@ void shouldAuthenticateMfaReset() { Map.of()); assertThat(response, hasStatus(200)); - assertEquals(1, txmaAuditQueue.getRawMessages().size()); checkCorrectKeysUsedViaIntegrationWithKms(response.getBody()); checkStateIsStoredViaIntegrationWithRedis(sessionId); @@ -198,10 +195,7 @@ private static void checkStateIsStoredViaIntegrationWithRedis(String sessionId) } private static void checkTxmaEventPublishedViaIntegrationWithSQS() { - Awaitility.await() - .atMost(Duration.ofSeconds(60)) - .pollInterval(Duration.ofSeconds(1)) - .until(() -> txmaAuditQueue.getApproximateMessageCount() > 0); + assertEquals(1, txmaAuditQueue.getRawMessages().size()); } private static void checkExecutionMetricsPublishedViaIntegrationWithCloudWatch() {