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

This commit is contained in:
David Phillips authored and GitHub committed 2026-10-12 22:07:30 -04:00
1 parent 29adf75330
commit d55b830a39
2 files changed
+2 -23

No files matched your search

@@ -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("/");
@@ -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");
}
}