diff --git a/src/test/java/io/github/hectorvent/floci/services/apigateway/ApiGatewayExecuteApiHostIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/apigateway/ApiGatewayExecuteApiHostIntegrationTest.java index 8afe6cb511..b4b8249ae9 100644 --- a/src/test/java/io/github/hectorvent/floci/services/apigateway/ApiGatewayExecuteApiHostIntegrationTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/apigateway/ApiGatewayExecuteApiHostIntegrationTest.java @@ -1,8 +1,8 @@ package io.github.hectorvent.floci.services.apigateway; import com.sun.net.httpserver.HttpServer; +import io.github.hectorvent.floci.testing.ConfiguredHostnameProfile; import io.quarkus.test.junit.QuarkusTest; -import io.quarkus.test.junit.QuarkusTestProfile; import io.quarkus.test.junit.TestProfile; import io.restassured.http.ContentType; import org.junit.jupiter.api.AfterAll; @@ -15,14 +15,13 @@ import org.junit.jupiter.api.TestMethodOrder; import java.io.IOException; import java.net.InetSocketAddress; import java.nio.charset.StandardCharsets; -import java.util.Map; import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; @QuarkusTest -@TestProfile(ApiGatewayExecuteApiHostIntegrationTest.ConfiguredHostnameProfile.class) +@TestProfile(ConfiguredHostnameProfile.class) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) class ApiGatewayExecuteApiHostIntegrationTest { @@ -329,11 +328,4 @@ class ApiGatewayExecuteApiHostIntegrationTest { .then() .statusCode(201); } - - public static class ConfiguredHostnameProfile implements QuarkusTestProfile { - @Override - public Map getConfigOverrides() { - return Map.of("floci.hostname", "floci"); - } - } } diff --git a/src/test/java/io/github/hectorvent/floci/services/cloudfront/CloudFrontS3AuthServingTest.java b/src/test/java/io/github/hectorvent/floci/services/cloudfront/CloudFrontS3AuthServingTest.java index 303c82d096..9df12bf22d 100644 --- a/src/test/java/io/github/hectorvent/floci/services/cloudfront/CloudFrontS3AuthServingTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/cloudfront/CloudFrontS3AuthServingTest.java @@ -7,8 +7,8 @@ import io.github.hectorvent.floci.services.cloudfront.model.DistributionConfig; import io.github.hectorvent.floci.services.cloudfront.model.Origin; import io.github.hectorvent.floci.services.cloudfront.model.OriginAccessControl; import io.github.hectorvent.floci.services.s3.S3Service; +import io.github.hectorvent.floci.testing.S3EnforceAuthProfile; import io.quarkus.test.junit.QuarkusTest; -import io.quarkus.test.junit.QuarkusTestProfile; import io.quarkus.test.junit.TestProfile; import jakarta.inject.Inject; import org.junit.jupiter.api.Test; @@ -22,7 +22,7 @@ import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.equalTo; @QuarkusTest -@TestProfile(CloudFrontS3AuthServingTest.S3AuthProfile.class) +@TestProfile(S3EnforceAuthProfile.class) class CloudFrontS3AuthServingTest { @Inject @@ -225,11 +225,4 @@ class CloudFrontS3AuthServingTest { + "/20260730/us-east-1/s3/aws4_request, " + "SignedHeaders=host;x-amz-date, Signature=abc123"; } - - public static final class S3AuthProfile implements QuarkusTestProfile { - @Override - public Map getConfigOverrides() { - return Map.of("floci.services.s3.enforce-auth", "true"); - } - } } diff --git a/src/test/java/io/github/hectorvent/floci/services/cur/CurEmissionIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/cur/CurEmissionIntegrationTest.java index 9555746462..a3b7782455 100644 --- a/src/test/java/io/github/hectorvent/floci/services/cur/CurEmissionIntegrationTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/cur/CurEmissionIntegrationTest.java @@ -3,15 +3,14 @@ package io.github.hectorvent.floci.services.cur; import io.github.hectorvent.floci.services.floci.duck.FlociDuckClient; import io.github.hectorvent.floci.services.s3.S3Service; import io.github.hectorvent.floci.testing.RestAssuredJsonUtils; +import io.github.hectorvent.floci.testing.SynchronousBillingEmissionProfile; import io.quarkus.test.junit.QuarkusTest; -import io.quarkus.test.junit.QuarkusTestProfile; import io.quarkus.test.junit.TestProfile; import jakarta.inject.Inject; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -35,7 +34,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; * {@link ParquetEmitterIntegrationTest} for prerequisites. */ @QuarkusTest -@TestProfile(CurEmissionIntegrationTest.SyncProfile.class) +@TestProfile(SynchronousBillingEmissionProfile.class) @EnabledIfEnvironmentVariable(named = "FLOCI_DUCK_CROSS_CONTAINER_TEST", matches = "1|true|yes") class CurEmissionIntegrationTest { @@ -45,22 +44,6 @@ class CurEmissionIntegrationTest { private static final String S3_AUTH = "AWS4-HMAC-SHA256 Credential=AKID/20260101/us-east-1/s3/aws4_request"; - /** - * Wires the full sync path: emit-mode=synchronous, fixed Floci HTTP port so - * the DuckDB sidecar can reach Floci S3 over the network. - */ - public static final class SyncProfile implements QuarkusTestProfile { - @Override - public Map getConfigOverrides() { - Map o = new HashMap<>(); - o.put("quarkus.http.test-port", "4566"); - o.put("floci.base-url", "http://localhost:4566"); - o.put("floci.services.cur.emit-mode", "synchronous"); - o.put("floci.services.bcm-data-exports.emit-mode", "synchronous"); - return o; - } - } - @BeforeAll static void configureRestAssured() { RestAssuredJsonUtils.configureAwsContentTypes(); diff --git a/src/test/java/io/github/hectorvent/floci/services/cur/CurNonDefaultAccountEmissionIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/cur/CurNonDefaultAccountEmissionIntegrationTest.java index 3c6319211b..f6471208f0 100644 --- a/src/test/java/io/github/hectorvent/floci/services/cur/CurNonDefaultAccountEmissionIntegrationTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/cur/CurNonDefaultAccountEmissionIntegrationTest.java @@ -1,16 +1,13 @@ package io.github.hectorvent.floci.services.cur; import io.github.hectorvent.floci.testing.RestAssuredJsonUtils; +import io.github.hectorvent.floci.testing.SynchronousBillingEmissionProfile; import io.quarkus.test.junit.QuarkusTest; -import io.quarkus.test.junit.QuarkusTestProfile; import io.quarkus.test.junit.TestProfile; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; -import java.util.HashMap; -import java.util.Map; - import static io.restassured.RestAssured.given; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.anyOf; @@ -30,7 +27,7 @@ import static org.hamcrest.Matchers.equalTo; * {@link ParquetEmitterIntegrationTest} for prerequisites. */ @QuarkusTest -@TestProfile(CurNonDefaultAccountEmissionIntegrationTest.SyncProfile.class) +@TestProfile(SynchronousBillingEmissionProfile.class) @EnabledIfEnvironmentVariable(named = "FLOCI_DUCK_CROSS_CONTAINER_TEST", matches = "1|true|yes") class CurNonDefaultAccountEmissionIntegrationTest { @@ -41,18 +38,6 @@ class CurNonDefaultAccountEmissionIntegrationTest { private static final String S3_AUTH = "AWS4-HMAC-SHA256 Credential=" + ACCOUNT_ID + "/20260101/us-east-1/s3/aws4_request"; - public static final class SyncProfile implements QuarkusTestProfile { - @Override - public Map getConfigOverrides() { - Map o = new HashMap<>(); - o.put("quarkus.http.test-port", "4566"); - o.put("floci.base-url", "http://localhost:4566"); - o.put("floci.services.cur.emit-mode", "synchronous"); - o.put("floci.services.bcm-data-exports.emit-mode", "synchronous"); - return o; - } - } - @BeforeAll static void configureRestAssured() { RestAssuredJsonUtils.configureAwsContentTypes(); diff --git a/src/test/java/io/github/hectorvent/floci/services/iot/IotEndpointHostnameIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/iot/IotEndpointHostnameIntegrationTest.java index afcbc8ff60..c9a8154a8d 100644 --- a/src/test/java/io/github/hectorvent/floci/services/iot/IotEndpointHostnameIntegrationTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/iot/IotEndpointHostnameIntegrationTest.java @@ -1,17 +1,15 @@ package io.github.hectorvent.floci.services.iot; +import io.github.hectorvent.floci.testing.ConfiguredHostnameProfile; 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.util.Map; - import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.equalTo; @QuarkusTest -@TestProfile(IotEndpointHostnameIntegrationTest.HostnameProfile.class) +@TestProfile(ConfiguredHostnameProfile.class) class IotEndpointHostnameIntegrationTest { @Test @@ -23,11 +21,4 @@ class IotEndpointHostnameIntegrationTest { .statusCode(200) .body("endpointAddress", equalTo("floci:4566")); } - - public static class HostnameProfile implements QuarkusTestProfile { - @Override - public Map getConfigOverrides() { - return Map.of("floci.hostname", "floci"); - } - } } diff --git a/src/test/java/io/github/hectorvent/floci/services/redshift/RedshiftInterceptorIamRoleEnforcedIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/redshift/RedshiftInterceptorIamRoleEnforcedIntegrationTest.java index 0d972fda03..1384cf795d 100644 --- a/src/test/java/io/github/hectorvent/floci/services/redshift/RedshiftInterceptorIamRoleEnforcedIntegrationTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/redshift/RedshiftInterceptorIamRoleEnforcedIntegrationTest.java @@ -3,8 +3,8 @@ package io.github.hectorvent.floci.services.redshift; import io.github.hectorvent.floci.services.iam.IamService; import io.github.hectorvent.floci.services.redshift.model.Cluster; import io.github.hectorvent.floci.services.s3.S3Service; +import io.github.hectorvent.floci.testing.S3EnforceAuthProfile; import io.quarkus.test.junit.QuarkusTest; -import io.quarkus.test.junit.QuarkusTestProfile; import io.quarkus.test.junit.TestProfile; import jakarta.inject.Inject; import org.awaitility.Awaitility; @@ -29,11 +29,11 @@ import static org.junit.jupiter.api.Assertions.assertThrows; /** * Covers COPY IAM_ROLE authorization when {@code FLOCI_SERVICES_S3_ENFORCE_AUTH} is on, so the * role's identity-based policy actually gates S3 access. Kept in its own {@code @QuarkusTest} - * class (own {@link EnforceAuthProfile}) because Quarkus restarts the application per distinct - * test profile; {@link RedshiftInterceptorIntegrationTest} runs with enforcement off. + * class (running under {@link S3EnforceAuthProfile}) because Quarkus restarts the application per + * distinct test profile; {@link RedshiftInterceptorIntegrationTest} runs with enforcement off. */ @QuarkusTest -@TestProfile(RedshiftInterceptorIamRoleEnforcedIntegrationTest.EnforceAuthProfile.class) +@TestProfile(S3EnforceAuthProfile.class) class RedshiftInterceptorIamRoleEnforcedIntegrationTest { private static final String REDSHIFT_TRUST_POLICY = """ @@ -131,11 +131,4 @@ class RedshiftInterceptorIamRoleEnforcedIntegrationTest { } } } - - public static final class EnforceAuthProfile implements QuarkusTestProfile { - @Override - public Map getConfigOverrides() { - return Map.of("floci.services.s3.enforce-auth", "true"); - } - } } diff --git a/src/test/java/io/github/hectorvent/floci/services/s3/S3AuthEnforcementIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/s3/S3AuthEnforcementIntegrationTest.java index 460bb655dc..b6359b89e4 100644 --- a/src/test/java/io/github/hectorvent/floci/services/s3/S3AuthEnforcementIntegrationTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/s3/S3AuthEnforcementIntegrationTest.java @@ -1,10 +1,10 @@ package io.github.hectorvent.floci.services.s3; import io.github.hectorvent.floci.services.iam.IamService; +import io.github.hectorvent.floci.testing.S3EnforceAuthProfile; import io.github.hectorvent.floci.testutil.S3RequestSigner; import io.restassured.specification.RequestSpecification; import io.quarkus.test.junit.QuarkusTest; -import io.quarkus.test.junit.QuarkusTestProfile; import io.quarkus.test.junit.TestProfile; import jakarta.inject.Inject; import org.junit.jupiter.api.MethodOrderer; @@ -35,7 +35,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.not; @QuarkusTest -@TestProfile(S3AuthEnforcementIntegrationTest.S3AuthProfile.class) +@TestProfile(S3EnforceAuthProfile.class) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) class S3AuthEnforcementIntegrationTest { @@ -2305,11 +2305,4 @@ class S3AuthEnforcementIntegrationTest { """; } - - public static final class S3AuthProfile implements QuarkusTestProfile { - @Override - public Map getConfigOverrides() { - return Map.of("floci.services.s3.enforce-auth", "true"); - } - } } diff --git a/src/test/java/io/github/hectorvent/floci/services/s3/S3BucketPolicyEnforcementIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/s3/S3BucketPolicyEnforcementIntegrationTest.java index 519203ed2c..98f3dd177b 100644 --- a/src/test/java/io/github/hectorvent/floci/services/s3/S3BucketPolicyEnforcementIntegrationTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/s3/S3BucketPolicyEnforcementIntegrationTest.java @@ -1,14 +1,13 @@ package io.github.hectorvent.floci.services.s3; +import io.github.hectorvent.floci.testing.S3IamEnforcementProfile; import io.github.hectorvent.floci.testutil.S3RequestSigner; import io.quarkus.test.junit.QuarkusTest; -import io.quarkus.test.junit.QuarkusTestProfile; import io.quarkus.test.junit.TestProfile; import io.restassured.response.ExtractableResponse; import io.restassured.response.Response; import org.junit.jupiter.api.Test; -import java.util.Map; import java.util.UUID; import static io.restassured.RestAssured.given; @@ -17,7 +16,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.junit.jupiter.api.Assertions.assertNotNull; @QuarkusTest -@TestProfile(S3BucketPolicyEnforcementIntegrationTest.EnforcementProfile.class) +@TestProfile(S3IamEnforcementProfile.class) class S3BucketPolicyEnforcementIntegrationTest { private static final String REGION = "us-east-1"; @@ -31,17 +30,6 @@ class S3BucketPolicyEnforcementIntegrationTest { } } - public static final class EnforcementProfile implements QuarkusTestProfile { - @Override - public Map getConfigOverrides() { - return Map.of( - "floci.services.s3.enforce-auth", "true", - "floci.services.iam.enforcement-enabled", "true", - "floci.services.s3.global-bucket-namespace", "true" - ); - } - } - private static String auth(String accessKeyId, String service) { return "AWS4-HMAC-SHA256 Credential=" + accessKeyId + "/20260629/" + REGION + "/" + service + "/aws4_request, SignedHeaders=host, Signature=abc"; diff --git a/src/test/java/io/github/hectorvent/floci/services/s3/S3CopyObjectSourcePermissionIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/s3/S3CopyObjectSourcePermissionIntegrationTest.java index 60de999edd..86a1160f31 100644 --- a/src/test/java/io/github/hectorvent/floci/services/s3/S3CopyObjectSourcePermissionIntegrationTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/s3/S3CopyObjectSourcePermissionIntegrationTest.java @@ -1,12 +1,11 @@ package io.github.hectorvent.floci.services.s3; +import io.github.hectorvent.floci.testing.S3IamEnforcementProfile; import io.github.hectorvent.floci.testutil.S3RequestSigner; 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.util.Map; import java.util.UUID; import static io.restassured.RestAssured.given; @@ -20,7 +19,7 @@ import static org.hamcrest.Matchers.containsString; * any object it could not otherwise read, as long as it could guess the bucket/key. */ @QuarkusTest -@TestProfile(S3CopyObjectSourcePermissionIntegrationTest.IamEnforcementProfile.class) +@TestProfile(S3IamEnforcementProfile.class) class S3CopyObjectSourcePermissionIntegrationTest { /** @@ -521,14 +520,4 @@ class S3CopyObjectSourcePermissionIntegrationTest { return "AWS4-HMAC-SHA256 Credential=" + accessKeyId + "/20260629/" + REGION + "/" + service + "/aws4_request, SignedHeaders=host, Signature=abc"; } - - public static final class IamEnforcementProfile implements QuarkusTestProfile { - @Override - public Map getConfigOverrides() { - return Map.of( - "floci.services.iam.enforcement-enabled", "true", - "floci.services.s3.enforce-auth", "true", - "floci.services.s3.global-bucket-namespace", "true"); - } - } } diff --git a/src/test/java/io/github/hectorvent/floci/services/s3/S3LeadingSlashKeyAuthEnforcementIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/s3/S3LeadingSlashKeyAuthEnforcementIntegrationTest.java index c8dda1c00c..7ccad6c9d8 100644 --- a/src/test/java/io/github/hectorvent/floci/services/s3/S3LeadingSlashKeyAuthEnforcementIntegrationTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/s3/S3LeadingSlashKeyAuthEnforcementIntegrationTest.java @@ -1,5 +1,6 @@ package io.github.hectorvent.floci.services.s3; +import io.github.hectorvent.floci.testing.S3EnforceAuthProfile; import io.github.hectorvent.floci.testutil.S3RequestSigner; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit.TestProfile; @@ -47,7 +48,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; * header must be set by hand). */ @QuarkusTest -@TestProfile(S3AuthEnforcementIntegrationTest.S3AuthProfile.class) +@TestProfile(S3EnforceAuthProfile.class) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) class S3LeadingSlashKeyAuthEnforcementIntegrationTest { diff --git a/src/test/java/io/github/hectorvent/floci/services/s3/S3PresignedTaggingSigV4EnforcementIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/s3/S3PresignedTaggingSigV4EnforcementIntegrationTest.java index 551898f311..e5009846f4 100644 --- a/src/test/java/io/github/hectorvent/floci/services/s3/S3PresignedTaggingSigV4EnforcementIntegrationTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/s3/S3PresignedTaggingSigV4EnforcementIntegrationTest.java @@ -1,5 +1,6 @@ package io.github.hectorvent.floci.services.s3; +import io.github.hectorvent.floci.testing.S3EnforceAuthProfile; import io.github.hectorvent.floci.testutil.S3RequestSigner; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit.TestProfile; @@ -32,7 +33,7 @@ import static org.hamcrest.Matchers.not; * query fallback, and that a tag parameter added after signing is rejected. */ @QuarkusTest -@TestProfile(S3AuthEnforcementIntegrationTest.S3AuthProfile.class) +@TestProfile(S3EnforceAuthProfile.class) class S3PresignedTaggingSigV4EnforcementIntegrationTest { private static final String BUCKET = "presigned-tagging-sigv4-bucket"; diff --git a/src/test/java/io/github/hectorvent/floci/testing/ConfiguredHostnameProfile.java b/src/test/java/io/github/hectorvent/floci/testing/ConfiguredHostnameProfile.java new file mode 100644 index 0000000000..0f71e165b3 --- /dev/null +++ b/src/test/java/io/github/hectorvent/floci/testing/ConfiguredHostnameProfile.java @@ -0,0 +1,17 @@ +package io.github.hectorvent.floci.testing; + +import io.quarkus.test.junit.QuarkusTestProfile; + +import java.util.Map; + +/** + * Sets an explicit {@code floci.hostname}, so a test can assert on the host a service advertises + * rather than on the default. + */ +public class ConfiguredHostnameProfile implements QuarkusTestProfile { + + @Override + public Map getConfigOverrides() { + return Map.of("floci.hostname", "floci"); + } +} diff --git a/src/test/java/io/github/hectorvent/floci/testing/S3EnforceAuthProfile.java b/src/test/java/io/github/hectorvent/floci/testing/S3EnforceAuthProfile.java new file mode 100644 index 0000000000..1c7540f909 --- /dev/null +++ b/src/test/java/io/github/hectorvent/floci/testing/S3EnforceAuthProfile.java @@ -0,0 +1,18 @@ +package io.github.hectorvent.floci.testing; + +import io.quarkus.test.junit.QuarkusTestProfile; + +import java.util.Map; + +/** + * Turns S3 request-signature enforcement on, and nothing else. Quarkus builds the application once + * per distinct profile class, so the classes that need only this override share this one rather + * than each declaring an identical nested profile. + */ +public class S3EnforceAuthProfile implements QuarkusTestProfile { + + @Override + public Map getConfigOverrides() { + return Map.of("floci.services.s3.enforce-auth", "true"); + } +} diff --git a/src/test/java/io/github/hectorvent/floci/testing/S3IamEnforcementProfile.java b/src/test/java/io/github/hectorvent/floci/testing/S3IamEnforcementProfile.java new file mode 100644 index 0000000000..fb39c07058 --- /dev/null +++ b/src/test/java/io/github/hectorvent/floci/testing/S3IamEnforcementProfile.java @@ -0,0 +1,20 @@ +package io.github.hectorvent.floci.testing; + +import io.quarkus.test.junit.QuarkusTestProfile; + +import java.util.Map; + +/** + * S3 auth enforcement, IAM enforcement and the global bucket namespace together, for the classes + * that need all three. {@link S3EnforceAuthProfile} covers the narrower case. + */ +public class S3IamEnforcementProfile implements QuarkusTestProfile { + + @Override + public Map getConfigOverrides() { + return Map.of( + "floci.services.s3.enforce-auth", "true", + "floci.services.iam.enforcement-enabled", "true", + "floci.services.s3.global-bucket-namespace", "true"); + } +} diff --git a/src/test/java/io/github/hectorvent/floci/testing/SynchronousBillingEmissionProfile.java b/src/test/java/io/github/hectorvent/floci/testing/SynchronousBillingEmissionProfile.java new file mode 100644 index 0000000000..9a70b7ad3f --- /dev/null +++ b/src/test/java/io/github/hectorvent/floci/testing/SynchronousBillingEmissionProfile.java @@ -0,0 +1,23 @@ +package io.github.hectorvent.floci.testing; + +import io.quarkus.test.junit.QuarkusTestProfile; + +import java.util.Map; + +/** + * Wires the full sync path for the billing report emitters: emit-mode=synchronous plus a fixed + * Floci HTTP port, so the DuckDB sidecar can reach Floci S3 over the network. Quarkus builds the + * application once per distinct profile class, so the classes that need this share one profile + * rather than each declaring an identical nested copy. + */ +public class SynchronousBillingEmissionProfile implements QuarkusTestProfile { + + @Override + public Map getConfigOverrides() { + return Map.of( + "quarkus.http.test-port", "4566", + "floci.base-url", "http://localhost:4566", + "floci.services.cur.emit-mode", "synchronous", + "floci.services.bcm-data-exports.emit-mode", "synchronous"); + } +}