mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
test(rds): share requests across existing integration suites (#5496)
This commit is contained in:
1 parent
4ff263271c
commit
c4d33a6bd8
5 files changed
+5
-58
No files matched your search
+1
-11
@@ -6,8 +6,7 @@ import io.quarkus.test.junit.TestProfile;
|
||||
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;
|
||||
|
||||
/**
|
||||
@@ -24,15 +23,6 @@ class RdsClusterEngineModeStorageEncryptedIntegrationTest {
|
||||
private static final String ID = "engine-mode-cluster";
|
||||
private static final String NON_AURORA_ID = "engine-mode-non-aurora-cluster";
|
||||
|
||||
private static io.restassured.specification.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("DeleteDBCluster").formParam("DBClusterIdentifier", ID)
|
||||
|
||||
+1
-12
@@ -3,12 +3,10 @@ package io.github.hectorvent.floci.services.rds;
|
||||
import io.github.hectorvent.floci.testing.RdsMockProfile;
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
import io.quarkus.test.junit.TestProfile;
|
||||
import io.restassured.specification.RequestSpecification;
|
||||
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;
|
||||
|
||||
/** RDS creation and restore responses must expose usable proxy ports on the wire. */
|
||||
@@ -24,15 +22,6 @@ class RdsClusterSnapshotRestorePortIntegrationTest {
|
||||
private static final String INSTANCE_SNAPSHOT = "restore-port-instance-snapshot";
|
||||
private static final String RESTORED_INSTANCE = "restore-port-instance-target";
|
||||
|
||||
private static RequestSpecification rds(String action) {
|
||||
return given().header("Authorization",
|
||||
"AWS4-HMAC-SHA256 Credential=test/20260924/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() {
|
||||
for (String id : new String[]{RESTORED_INSTANCE, INSTANCE}) {
|
||||
|
||||
+1
-13
@@ -4,7 +4,6 @@ import com.github.dockerjava.api.DockerClient;
|
||||
import io.github.hectorvent.floci.services.iam.IamService;
|
||||
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;
|
||||
@@ -19,8 +18,7 @@ import java.time.Duration;
|
||||
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.awaitility.Awaitility.await;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
@@ -39,9 +37,6 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||
@Tag("docker")
|
||||
class RdsIamAuthLambdaSessionIntegrationTest {
|
||||
|
||||
private static final String RDS_AUTH =
|
||||
"AWS4-HMAC-SHA256 Credential=test/20261002/us-east-1/rds/aws4_request, "
|
||||
+ "SignedHeaders=content-type;host, Signature=test";
|
||||
private static final String ACCOUNT_ID = "000000000000";
|
||||
private static final String MASTER_USER = "master";
|
||||
private static final String MASTER_PASSWORD = "Master123!";
|
||||
@@ -123,11 +118,4 @@ class RdsIamAuthLambdaSessionIntegrationTest {
|
||||
properties.setProperty("connectTimeout", "5");
|
||||
return DriverManager.getConnection("jdbc:postgresql://127.0.0.1:" + port + "/" + DATABASE, properties);
|
||||
}
|
||||
|
||||
private static RequestSpecification rds(String action) {
|
||||
return given().header("Authorization", RDS_AUTH)
|
||||
.contentType(URLENC)
|
||||
.formParam("Action", action)
|
||||
.formParam("Version", "2014-10-31");
|
||||
}
|
||||
}
|
||||
+1
-11
@@ -8,8 +8,7 @@ import io.restassured.specification.RequestSpecification;
|
||||
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;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.not;
|
||||
@@ -31,15 +30,6 @@ class RdsInstanceMonitoringFieldsIntegrationTest {
|
||||
private static final String RESULT =
|
||||
"DescribeDBInstancesResponse.DescribeDBInstancesResult.DBInstances.DBInstance.";
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
private static RequestSpecification create() {
|
||||
return rds("CreateDBInstance")
|
||||
.formParam("DBInstanceIdentifier", ID)
|
||||
|
||||
+1
-11
@@ -8,8 +8,7 @@ import io.restassured.specification.RequestSpecification;
|
||||
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;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
@@ -27,15 +26,6 @@ class RdsInstanceScalingIntegrationTest {
|
||||
private static final String RESULT =
|
||||
"DescribeDBInstancesResponse.DescribeDBInstancesResult.DBInstances.DBInstance.";
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
private static void create() {
|
||||
rds("CreateDBInstance")
|
||||
.formParam("DBInstanceIdentifier", ID)
|
||||
|
||||
Reference in new issue
Block a user