Skip to content

armgit / floci

Public Imported from GitHub
0

Light, fluffy, and always free - The AWS Local Emulator alternative

test(cloudformation): await autoscaling stack lifecycle (#6260)

Andre Kurait6b7566bf0526
diff --git a/src/test/java/io/github/hectorvent/floci/services/cloudformation/CloudFormationApplicationAutoScalingIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/cloudformation/CloudFormationApplicationAutoScalingIntegrationTest.java
index e2ebe3743d..5abd182c9c 100644
--- a/src/test/java/io/github/hectorvent/floci/services/cloudformation/CloudFormationApplicationAutoScalingIntegrationTest.java
+++ b/src/test/java/io/github/hectorvent/floci/services/cloudformation/CloudFormationApplicationAutoScalingIntegrationTest.java
@@ -1,5 +1,6 @@
package io.github.hectorvent.floci.services.cloudformation;
+import io.github.hectorvent.floci.testing.CfnStackWaits;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.config.EncoderConfig;
@@ -9,6 +10,7 @@ import org.junit.jupiter.api.Test;
import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;
+import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* End-to-end check that CloudFormation provisions Application Auto Scaling for real rather than
@@ -80,6 +82,8 @@ class CloudFormationApplicationAutoScalingIntegrationTest {
.then()
.statusCode(200);
+ assertEquals("CREATE_COMPLETE", CfnStackWaits.awaitTerminal(stackName, CFN_AUTH).status());
+
given()
.contentType("application/x-www-form-urlencoded")
.header("Authorization", CFN_AUTH)
@@ -164,6 +168,8 @@ class CloudFormationApplicationAutoScalingIntegrationTest {
.then()
.statusCode(200);
+ assertEquals("CREATE_COMPLETE", CfnStackWaits.awaitTerminal(stackName, CFN_AUTH).status());
+
given()
.contentType("application/x-www-form-urlencoded")
.header("Authorization", CFN_AUTH)
@@ -174,6 +180,8 @@ class CloudFormationApplicationAutoScalingIntegrationTest {
.then()
.statusCode(200);
+ CfnStackWaits.awaitStackDeleted(stackName, CFN_AUTH);
+
given()
.config(RestAssured.config().encoderConfig(EncoderConfig.encoderConfig()
.encodeContentTypeAs("application/x-amz-json-1.1", ContentType.TEXT)))