Skip to content

armgit / floci

Public Imported from GitHub
0

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

test(rds): share requests in startup and DocumentDB suites (#5544)

David Phillipsd55b830a39ad
diff --git a/src/test/java/io/github/hectorvent/floci/services/docdb/DocDbClusterSettingsIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/docdb/DocDbClusterSettingsIntegrationTest.java
index 17e02a5f6d..9eaed5e90d 100644
--- a/src/test/java/io/github/hectorvent/floci/services/docdb/DocDbClusterSettingsIntegrationTest.java
+++ b/src/test/java/io/github/hectorvent/floci/services/docdb/DocDbClusterSettingsIntegrationTest.java
@@ -6,13 +6,11 @@ import io.github.hectorvent.floci.services.kms.KmsService;
import io.github.hectorvent.floci.testing.RdsAndDocDbMockProfile;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.TestProfile;
-import io.restassured.specification.RequestSpecification;
import jakarta.inject.Inject;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
-import static io.restassured.RestAssured.given;
-import static io.restassured.http.ContentType.URLENC;
+import static io.github.hectorvent.floci.testing.RdsRequests.rds;
import static org.hamcrest.Matchers.containsString;
/**
@@ -32,15 +30,6 @@ class DocDbClusterSettingsIntegrationTest {
@Inject
Ec2Service ec2Service;
- private static RequestSpecification rds(String action) {
- return given().header("Authorization",
- "AWS4-HMAC-SHA256 Credential=test/20260615/us-east-1/rds/aws4_request, "
- + "SignedHeaders=content-type;host, Signature=test")
- .contentType(URLENC)
- .formParam("Action", action)
- .formParam("Version", "2014-10-31");
- }
-
@AfterEach
void cleanUp() {
rds("DeleteDBInstance").formParam("DBInstanceIdentifier", ID + "-1").when().post("/");
diff --git a/src/test/java/io/github/hectorvent/floci/services/rds/proxy/RdsPostgresStartupParametersIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/rds/proxy/RdsPostgresStartupParametersIntegrationTest.java
index 0227848abc..5eba9fdaa2 100644
--- a/src/test/java/io/github/hectorvent/floci/services/rds/proxy/RdsPostgresStartupParametersIntegrationTest.java
+++ b/src/test/java/io/github/hectorvent/floci/services/rds/proxy/RdsPostgresStartupParametersIntegrationTest.java
@@ -3,7 +3,6 @@ package io.github.hectorvent.floci.services.rds.proxy;
import com.github.dockerjava.api.DockerClient;
import io.github.hectorvent.floci.testutil.SigV4TokenTestHelper;
import io.quarkus.test.junit.QuarkusTest;
-import io.restassured.specification.RequestSpecification;
import jakarta.inject.Inject;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
@@ -17,8 +16,7 @@ import java.sql.Statement;
import java.time.Instant;
import java.util.Properties;
-import static io.restassured.RestAssured.given;
-import static io.restassured.http.ContentType.URLENC;
+import static io.github.hectorvent.floci.testing.RdsRequests.rds;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.jupiter.api.Assertions.assertThrows;
@@ -34,7 +32,6 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue;
@Tag("docker")
class RdsPostgresStartupParametersIntegrationTest {
- private static final String RDS_AUTH = "AWS4-HMAC-SHA256 Credential=test/20261006/us-east-1/rds/aws4_request";
private static final String MASTER_USER = "master";
private static final String MASTER_PASSWORD = "Master123!";
@@ -235,11 +232,4 @@ class RdsPostgresStartupParametersIntegrationTest {
return rows.getString(1);
}
}
-
- private static RequestSpecification rds(String action) {
- return given().header("Authorization", RDS_AUTH)
- .contentType(URLENC)
- .formParam("Action", action)
- .formParam("Version", "2014-10-31");
- }
}