Skip to content

armgit / floci

Public Imported from GitHub
0

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

test(redshift): clean up a partially created shared cluster (#4005)

Vũ Thế Huycc767e8976dd
diff --git a/src/test/java/io/github/hectorvent/floci/services/redshift/RedshiftInterceptorIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/redshift/RedshiftInterceptorIntegrationTest.java
index 16bdd3c45d..084bac753b 100644
--- a/src/test/java/io/github/hectorvent/floci/services/redshift/RedshiftInterceptorIntegrationTest.java
+++ b/src/test/java/io/github/hectorvent/floci/services/redshift/RedshiftInterceptorIntegrationTest.java
@@ -59,17 +59,19 @@ class RedshiftInterceptorIntegrationTest {
IamService iamService;
private Cluster sharedCluster;
+ private String sharedClusterId;
@BeforeAll
void createSharedCluster() {
Assumptions.assumeTrue(isDockerAvailable(), "Docker daemon must be available for Redshift interceptor integration tests");
+ sharedClusterId = SHARED_CLUSTER_ID;
sharedCluster = service.createCluster(SHARED_CLUSTER_ID, "dc2.large", "admin", "Secret123");
}
@AfterAll
void deleteSharedCluster() {
- if (sharedCluster != null) {
- service.deleteCluster(SHARED_CLUSTER_ID);
+ if (sharedClusterId != null) {
+ service.deleteCluster(sharedClusterId);
}
}
diff --git a/src/test/java/io/github/hectorvent/floci/services/redshiftdata/RedshiftDataApiIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/redshiftdata/RedshiftDataApiIntegrationTest.java
index 63b564e4c8..951e074801 100644
--- a/src/test/java/io/github/hectorvent/floci/services/redshiftdata/RedshiftDataApiIntegrationTest.java
+++ b/src/test/java/io/github/hectorvent/floci/services/redshiftdata/RedshiftDataApiIntegrationTest.java
@@ -34,8 +34,8 @@ class RedshiftDataApiIntegrationTest {
void createSharedCluster() {
Assumptions.assumeTrue(dockerAvailable(), "Docker is required for Redshift Data API integration tests");
RestAssuredJsonUtils.configureAwsContentTypes();
- redshift.createCluster(SHARED_CLUSTER_ID, "dc2.large", "admin", "Secret123");
clusterId = SHARED_CLUSTER_ID;
+ redshift.createCluster(SHARED_CLUSTER_ID, "dc2.large", "admin", "Secret123");
}
private static boolean dockerAvailable() {