mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
test(elbv2): reuse the real data-plane profile (#7453)
Share the existing identical profile across HTTPS routing and initial health fixtures. Preserve every test case and assertion. Signed-off-by: Andre Kurait <akurait@amazon.com>
This commit is contained in:
1 parent
3dbbb46161
commit
8e436d53a0
2 files changed
+4
-19
No files matched your search
+2
-9
@@ -14,10 +14,10 @@ import io.github.hectorvent.floci.services.acm.model.ValidationMethod;
|
||||
import io.github.hectorvent.floci.services.ec2.Ec2Service;
|
||||
import io.github.hectorvent.floci.testing.AlbFixtures;
|
||||
import io.github.hectorvent.floci.testing.InlineMocks;
|
||||
import io.github.hectorvent.floci.testing.RealElbV2DataPlaneProfile;
|
||||
import io.github.hectorvent.floci.testing.RestAssuredJsonUtils;
|
||||
import io.quarkus.arc.ClientProxy;
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
import io.quarkus.test.junit.QuarkusTestProfile;
|
||||
import io.quarkus.test.junit.TestProfile;
|
||||
import io.restassured.response.Response;
|
||||
import io.restassured.specification.RequestSpecification;
|
||||
@@ -89,17 +89,10 @@ import static org.mockito.Mockito.doAnswer;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
@QuarkusTest
|
||||
@TestProfile(ElbV2HttpsDataPlaneIntegrationTest.RealElbV2DataPlaneProfile.class)
|
||||
@TestProfile(RealElbV2DataPlaneProfile.class)
|
||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||
class ElbV2HttpsDataPlaneIntegrationTest {
|
||||
|
||||
public static final class RealElbV2DataPlaneProfile implements QuarkusTestProfile {
|
||||
@Override
|
||||
public Map<String, String> getConfigOverrides() {
|
||||
return Map.of("floci.services.elbv2.mock", "false");
|
||||
}
|
||||
}
|
||||
|
||||
private static final String REGION = "us-east-1";
|
||||
private static final String AUTH =
|
||||
"AWS4-HMAC-SHA256 Credential=test/20260720/us-east-1/elasticloadbalancing/aws4_request";
|
||||
|
||||
+2
-10
@@ -2,14 +2,13 @@ package io.github.hectorvent.floci.services.elbv2;
|
||||
|
||||
import com.sun.net.httpserver.HttpServer;
|
||||
import io.github.hectorvent.floci.services.ec2.Ec2Service;
|
||||
import io.github.hectorvent.floci.testing.RealElbV2DataPlaneProfile;
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
import io.quarkus.test.junit.QuarkusTestProfile;
|
||||
import io.quarkus.test.junit.TestProfile;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import java.time.Duration;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import static io.restassured.RestAssured.given;
|
||||
@@ -18,19 +17,12 @@ import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
@QuarkusTest
|
||||
@TestProfile(ElbV2InitialHealthIntegrationTest.RealHealthChecks.class)
|
||||
@TestProfile(RealElbV2DataPlaneProfile.class)
|
||||
class ElbV2InitialHealthIntegrationTest {
|
||||
|
||||
private static final String AUTH =
|
||||
"AWS4-HMAC-SHA256 Credential=test/20261025/us-east-1/elasticloadbalancing/aws4_request";
|
||||
|
||||
public static class RealHealthChecks implements QuarkusTestProfile {
|
||||
@Override
|
||||
public Map<String, String> getConfigOverrides() {
|
||||
return Map.of("floci.services.elbv2.mock", "false");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void registeredTargetBecomesHealthyAfterOneActualHttpProbe() throws Exception {
|
||||
AtomicInteger probes = new AtomicInteger();
|
||||
|
||||
Reference in new issue
Block a user