This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new e999b99e6c Migrate AWS test infrastructure from LocalStack to Floci
e999b99e6c is described below
commit e999b99e6c00e29b3b87975b1035b01b498c4336
Author: James Netherton <[email protected]>
AuthorDate: Fri Jun 26 13:25:45 2026 +0100
Migrate AWS test infrastructure from LocalStack to Floci
Fixes #8760
Co-authored-by: Claude Opus 4.6 <[email protected]>
---
integration-test-groups/aws2/README.adoc | 4 +-
.../secrets/manager/it/AwsSecretsManagerTest.java | 27 ++++---
.../it/AwsSecretsManagerTestEnvCustomizer.java | 6 +-
.../it/CamelContextRefreshOnSecretRefreshIT.java | 2 +-
.../it/CamelContextRefreshOnSecretRefreshTest.java | 2 +-
.../src/test/resources/lambda/rotation_handler.py | 16 ++--
.../src/test/resources/lambda/rotation_handler.zip | Bin 2311 -> 2278 bytes
.../aws2/cw/it/Aws2CwTestEnvCustomizer.java | 2 +-
.../aws2/ddb/it/Aws2DdbTestEnvCustomizer.java | 2 +-
integration-test-groups/aws2/aws2-ec2/README.adoc | 2 +-
.../aws2/ec2/it/Aws2Ec2TestEnvCustomizer.java | 2 +-
integration-test-groups/aws2/aws2-ecs/README.adoc | 2 +-
integration-test-groups/aws2/aws2-iam/README.adoc | 2 +-
.../aws2/iam/it/Aws2IamTestEnvCustomizer.java | 2 +-
.../kinesis/it/Aws2KinesisTestEnvCustomizer.java | 4 +-
.../aws2/kms/it/Aws2KmsTestEnvCustomizer.java | 2 +-
.../component/aws2/lambda/it/Aws2LambdaTest.java | 3 -
.../lambda/it/Aws2LambdaTestEnvCustomizer.java | 4 +-
integration-test-groups/aws2/aws2-mq/README.adoc | 2 +-
integration-test-groups/aws2/aws2-msk/README.adoc | 2 +-
.../aws2/s3/it/Aws2S3TestEnvCustomizer.java | 4 +-
.../quarkus/component/aws2/ses/it/Aws2SesIT.java | 3 +-
.../quarkus/component/aws2/ses/it/Aws2SesTest.java | 3 +-
.../aws2/ses/it/Aws2SesTestEnvCustomizer.java | 2 +-
.../component/aws2/sns/it/Aws2SqsSnsTest.java | 8 +-
.../aws2/sns/it/Aws2SqsSnsTestEnvCustomizer.java | 2 +-
.../quarkus/component/aws2/sqs/it/Aws2SqsTest.java | 10 +--
.../aws2/sqs/it/Aws2SqsTestEnvCustomizer.java | 6 +-
integration-tests-support/aws2/pom.xml | 6 +-
.../{Aws2LocalStack.java => Aws2MockBackend.java} | 2 +-
.../test/support/aws2/Aws2TestEnvContext.java | 39 +++++++---
.../test/support/aws2/Aws2TestEnvCustomizer.java | 13 ++--
.../test/support/aws2/Aws2TestResource.java | 85 ++++++++++++++-------
...2LocalStack.java => DockerSocketAvailable.java} | 16 ++--
integration-tests-support/debezium/pom.xml | 2 +-
pom.xml | 2 +-
poms/bom-test/pom.xml | 2 +-
37 files changed, 170 insertions(+), 123 deletions(-)
diff --git a/integration-test-groups/aws2/README.adoc
b/integration-test-groups/aws2/README.adoc
index d499a3991b..158d953146 100644
--- a/integration-test-groups/aws2/README.adoc
+++ b/integration-test-groups/aws2/README.adoc
@@ -1,8 +1,8 @@
= AWS 2 isolated integration tests
-=== Localstack
+=== Floci
-The tests able to run against Localstack are run against Localstack by default.
+The tests able to run against Floci are run against Floci by default.
The SES test is ignored unless `MAILSLURP_API_KEY` variable is set.
diff --git
a/integration-test-groups/aws2/aws-secrets-manager/src/test/java/org/apache/camel/quarkus/component/aws/secrets/manager/it/AwsSecretsManagerTest.java
b/integration-test-groups/aws2/aws-secrets-manager/src/test/java/org/apache/camel/quarkus/component/aws/secrets/manager/it/AwsSecretsManagerTest.java
index 38d6785760..50825db6e6 100644
---
a/integration-test-groups/aws2/aws-secrets-manager/src/test/java/org/apache/camel/quarkus/component/aws/secrets/manager/it/AwsSecretsManagerTest.java
+++
b/integration-test-groups/aws2/aws-secrets-manager/src/test/java/org/apache/camel/quarkus/component/aws/secrets/manager/it/AwsSecretsManagerTest.java
@@ -35,6 +35,7 @@ import
org.apache.camel.quarkus.test.mock.backend.MockBackendUtils;
import org.apache.camel.quarkus.test.support.aws2.Aws2Client;
import org.apache.camel.quarkus.test.support.aws2.Aws2TestResource;
import org.apache.camel.quarkus.test.support.aws2.BaseAWs2TestSupport;
+import org.apache.camel.quarkus.test.support.aws2.DockerSocketAvailable;
import org.apache.camel.quarkus.test.support.aws2.Service;
import org.apache.camel.util.CollectionHelper;
import org.apache.commons.lang3.RandomStringUtils;
@@ -61,10 +62,10 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
@QuarkusTestResource(Aws2TestResource.class)
public class AwsSecretsManagerTest extends BaseAWs2TestSupport {
- public static final String name2ToCreate = "CQTestSecret2-operation-2-" +
System.currentTimeMillis();
private static final Logger log =
Logger.getLogger(AwsSecretsManagerTest.class);
private static String lambdaArn;
private static String lambdaName;
+ private String name2ToCreate;
@Aws2Client(Service.LAMBDA)
LambdaClient lambdaClient;
@@ -75,7 +76,7 @@ public class AwsSecretsManagerTest extends
BaseAWs2TestSupport {
super("/aws-secrets-manager");
}
- public void setupLambdaFunction() throws IOException {
+ public void setupLambdaFunction(String secretName) throws IOException {
String lambdaHandler = "rotation_handler.lambda_handler";
String awsAccountId = "000000000000";
if (!MockBackendUtils.startMockBackend(false)) {
@@ -113,7 +114,7 @@ public class AwsSecretsManagerTest extends
BaseAWs2TestSupport {
.action("lambda:InvokeFunction")
.principal("secretsmanager.amazonaws.com")
.sourceArn("arn:aws:secretsmanager:%s:%s:secret:%s*"
- .formatted(System.getenv("AWS_REGION"),
awsAccountId, AwsSecretsManagerTest.name2ToCreate))
+ .formatted(System.getenv("AWS_REGION"),
awsAccountId, secretName))
.build();
lambdaClient.addPermission(permissionRequest);
@@ -128,14 +129,17 @@ public class AwsSecretsManagerTest extends
BaseAWs2TestSupport {
}
@Test
+ @EnabledIf(DockerSocketAvailable.class)
public void testOperations() throws IOException {
- setupLambdaFunction();
-
final String secretToCreate = "loadFirst";
final String secret2ToCreate = "changeit2";
final String secretToUpdate = "loadSecond";
final String nameToCreate = "CQTestSecret-operation-1-" +
System.currentTimeMillis();
+ name2ToCreate = "CQTestSecret2-operation-2-" +
System.currentTimeMillis();
final String description2ToCreate = "description-" + name2ToCreate;
+
+ setupLambdaFunction(name2ToCreate);
+
String createdArn = null;
String createdArn2 = null;
@@ -165,6 +169,7 @@ public class AwsSecretsManagerTest extends
BaseAWs2TestSupport {
Awaitility.await().pollInterval(5, TimeUnit.SECONDS).atMost(1,
TimeUnit.MINUTES).untilAsserted(
() -> {
Map<String, Boolean> secrets =
AwsSecretsManagerUtil.listSecrets(null);
+
// contains both created secrets
assertTrue(secrets.containsKey(finalCreatedArn));
assertTrue(secrets.containsKey(finalCreatedArn2));
@@ -206,9 +211,7 @@ public class AwsSecretsManagerTest extends
BaseAWs2TestSupport {
String rotateOperation =
SecretsManagerOperations.rotateSecret.toString();
if (MockBackendUtils.startMockBackend(false)) {
- // rotate secret2 with rotation rules set to fix issue with
LocalStack
- // on real AWS use the default Camel rotateSecret operation
without POJO involved
- // this workaround is only for older LocalStack - it is not
needed in 4.12.0 (probably fixed via
https://github.com/localstack/localstack/pull/12391/)
+ // rotate secret2 with rotation rules set to work around mock
backend limitations
rotateOperation = "rotateSecretWithRotationRulesSet";
}
@@ -292,7 +295,7 @@ public class AwsSecretsManagerTest extends
BaseAWs2TestSupport {
assertTrue(secrets.containsKey(finalCreatedArn2));
});
- // operation replicateSecretToRegions fails on local stack with 500
+ // operation replicateSecretToRegions fails on mock backend with
500
// There is no possibility to delete secret in different region
via camel
// find different region then the actually used
@@ -307,7 +310,7 @@ public class AwsSecretsManagerTest extends
BaseAWs2TestSupport {
// .body(is("true"));
} finally {
// we must clean created secrets
- // also on localstack, if not the second run of operations would
fail
+ // also on mock backend, if not the second run of operations would
fail
AwsSecretsManagerUtil.deleteSecretImmediately(createdArn);
AwsSecretsManagerUtil.deleteSecretImmediately(createdArn2);
@@ -326,7 +329,7 @@ public class AwsSecretsManagerTest extends
BaseAWs2TestSupport {
assertNotNull(createdArn);
} finally {
// we must clean created secrets
- // also on localstack, if not the second run of operations would
fail
+ // also on mock backend, if not the second run of operations would
fail
AwsSecretsManagerUtil.deleteSecretImmediately(createdArn);
}
}
@@ -365,7 +368,7 @@ public class AwsSecretsManagerTest extends
BaseAWs2TestSupport {
} finally {
if (!MockBackendUtils.startMockBackend(false)) {
// we must clean created secrets
- // skip cleaning on localstack
+ // skip cleaning on mock backend
AwsSecretsManagerUtil.deleteSecretImmediately(createdArn);
}
}
diff --git
a/integration-test-groups/aws2/aws-secrets-manager/src/test/java/org/apache/camel/quarkus/component/aws/secrets/manager/it/AwsSecretsManagerTestEnvCustomizer.java
b/integration-test-groups/aws2/aws-secrets-manager/src/test/java/org/apache/camel/quarkus/component/aws/secrets/manager/it/AwsSecretsManagerTestEnvCustomizer.java
index e79b4f5fc1..487d024486 100644
---
a/integration-test-groups/aws2/aws-secrets-manager/src/test/java/org/apache/camel/quarkus/component/aws/secrets/manager/it/AwsSecretsManagerTestEnvCustomizer.java
+++
b/integration-test-groups/aws2/aws-secrets-manager/src/test/java/org/apache/camel/quarkus/component/aws/secrets/manager/it/AwsSecretsManagerTestEnvCustomizer.java
@@ -31,8 +31,8 @@ import
software.amazon.awssdk.services.sqs.model.DeleteQueueRequest;
public class AwsSecretsManagerTestEnvCustomizer implements
Aws2TestEnvCustomizer {
@Override
- public Service[] localstackServices() {
- return new Service[] { Service.SECRETSMANAGER, Service.SQS };
+ public Service[] awsServices() {
+ return new Service[] { Service.SECRETSMANAGER, Service.SQS,
Service.LAMBDA };
}
@Override
@@ -62,7 +62,7 @@ public class AwsSecretsManagerTestEnvCustomizer implements
Aws2TestEnvCustomizer
+
RandomStringUtils.secure().nextAlphanumeric(49).toLowerCase(Locale.ROOT);
//configure endpoint override for properties function
- if (envContext.isLocalStack()) {
+ if (envContext.isMockBackend()) {
envContext.property("camel.vault.aws.override-endpoint",
envContext.getProperties().get("camel.component.aws-secrets-manager.override-endpoint"));
envContext.property("camel.vault.aws.uri-endpoint-override",
diff --git
a/integration-test-groups/aws2/aws-secrets-manager/src/test/java/org/apache/camel/quarkus/component/aws/secrets/manager/it/CamelContextRefreshOnSecretRefreshIT.java
b/integration-test-groups/aws2/aws-secrets-manager/src/test/java/org/apache/camel/quarkus/component/aws/secrets/manager/it/CamelContextRefreshOnSecretRefreshIT.java
index 872b716904..82e4fc8921 100644
---
a/integration-test-groups/aws2/aws-secrets-manager/src/test/java/org/apache/camel/quarkus/component/aws/secrets/manager/it/CamelContextRefreshOnSecretRefreshIT.java
+++
b/integration-test-groups/aws2/aws-secrets-manager/src/test/java/org/apache/camel/quarkus/component/aws/secrets/manager/it/CamelContextRefreshOnSecretRefreshIT.java
@@ -21,7 +21,7 @@ import org.apache.camel.quarkus.test.EnabledIf;
import org.apache.camel.quarkus.test.mock.backend.MockBackendDisabled;
@QuarkusIntegrationTest
-// disabled on Localstack due to
https://docs.localstack.cloud/references/coverage/coverage_cloudtrail/#lookupevents
+// disabled on mock backend due to lack of CloudTrail lookupEvents support
@EnabledIf(MockBackendDisabled.class)
class CamelContextRefreshOnSecretRefreshIT extends
CamelContextRefreshOnSecretRefreshTest {
diff --git
a/integration-test-groups/aws2/aws-secrets-manager/src/test/java/org/apache/camel/quarkus/component/aws/secrets/manager/it/CamelContextRefreshOnSecretRefreshTest.java
b/integration-test-groups/aws2/aws-secrets-manager/src/test/java/org/apache/camel/quarkus/component/aws/secrets/manager/it/CamelContextRefreshOnSecretRefreshTest.java
index 87d76af610..f377bd21ca 100644
---
a/integration-test-groups/aws2/aws-secrets-manager/src/test/java/org/apache/camel/quarkus/component/aws/secrets/manager/it/CamelContextRefreshOnSecretRefreshTest.java
+++
b/integration-test-groups/aws2/aws-secrets-manager/src/test/java/org/apache/camel/quarkus/component/aws/secrets/manager/it/CamelContextRefreshOnSecretRefreshTest.java
@@ -37,7 +37,7 @@ import static org.hamcrest.CoreMatchers.is;
@QuarkusTest
@QuarkusTestResource(Aws2TestResource.class)
@TestProfile(ContextReloadTestProfile.class)
-// disabled on Localstack due to
https://docs.localstack.cloud/references/coverage/coverage_cloudtrail/#lookupevents
+// disabled on mock backend due to lack of CloudTrail lookupEvents support
@EnabledIf(MockBackendDisabled.class)
public class CamelContextRefreshOnSecretRefreshTest {
@Test
diff --git
a/integration-test-groups/aws2/aws-secrets-manager/src/test/resources/lambda/rotation_handler.py
b/integration-test-groups/aws2/aws-secrets-manager/src/test/resources/lambda/rotation_handler.py
index 9f20ad380f..f5940afa52 100644
---
a/integration-test-groups/aws2/aws-secrets-manager/src/test/resources/lambda/rotation_handler.py
+++
b/integration-test-groups/aws2/aws-secrets-manager/src/test/resources/lambda/rotation_handler.py
@@ -25,17 +25,17 @@ from botocore.exceptions import ClientError
logger = logging.getLogger()
logger.setLevel(logging.INFO)
-# Determine the LocalStack endpoint dynamically
+# Determine the mock backend endpoint dynamically
ENDPOINT_URL = None
-if os.environ.get('LOCALSTACK_HOSTNAME'):
- # Default LocalStack port is 4566
- ENDPOINT_URL =
f"http://{os.environ.get('LOCALSTACK_HOSTNAME')}:{os.environ.get('EDGE_PORT',
4566)}"
+if os.environ.get('AWS_ENDPOINT_URL'):
+ # Floci injects AWS_ENDPOINT_URL (standard AWS SDK convention)
+ ENDPOINT_URL = os.environ.get('AWS_ENDPOINT_URL')
# Initialize Secrets Manager client
secrets_manager = boto3.client(
'secretsmanager',
- region_name=os.environ.get('AWS_REGION', 'us-east-1'), # Default
LocalStack region is 'us-east-1'
+ region_name=os.environ.get('AWS_REGION', 'us-east-1'),
endpoint_url=ENDPOINT_URL
)
@@ -121,18 +121,18 @@ def create_secret(arn, token, current_version_id):
def set_secret(arn, token):
"""(Step 2) Updates the underlying service/database. (Skipped for
simulation)"""
- logger.info("Executing setSecret step. (Skipped for simple LocalStack
test)")
+ logger.info("Executing setSecret step. (Skipped for simple mock backend
test)")
return {}
def test_secret(arn, token):
"""(Step 3) Validates the new secret. (Skipped for simulation)"""
- logger.info("Executing testSecret step. (Skipped for simple LocalStack
test)")
+ logger.info("Executing testSecret step. (Skipped for simple mock backend
test)")
return {}
def finish_secret(arn, token, current_version_id):
"""
(Step 4) Moves the AWSCURRENT label from the old version to the PENDING
version.
- Requires explicit removal of AWSCURRENT from the old ID for
LocalStack/Moto.
+ Requires explicit removal of AWSCURRENT from the old ID for mock backends.
"""
logger.info("Executing finishSecret step.")
diff --git
a/integration-test-groups/aws2/aws-secrets-manager/src/test/resources/lambda/rotation_handler.zip
b/integration-test-groups/aws2/aws-secrets-manager/src/test/resources/lambda/rotation_handler.zip
index aaaae0a6c0..11bdbf4e34 100644
Binary files
a/integration-test-groups/aws2/aws-secrets-manager/src/test/resources/lambda/rotation_handler.zip
and
b/integration-test-groups/aws2/aws-secrets-manager/src/test/resources/lambda/rotation_handler.zip
differ
diff --git
a/integration-test-groups/aws2/aws2-cw/src/test/java/org/apache/camel/quarkus/component/aws2/cw/it/Aws2CwTestEnvCustomizer.java
b/integration-test-groups/aws2/aws2-cw/src/test/java/org/apache/camel/quarkus/component/aws2/cw/it/Aws2CwTestEnvCustomizer.java
index 3b31b5f6bf..ed0743a966 100644
---
a/integration-test-groups/aws2/aws2-cw/src/test/java/org/apache/camel/quarkus/component/aws2/cw/it/Aws2CwTestEnvCustomizer.java
+++
b/integration-test-groups/aws2/aws2-cw/src/test/java/org/apache/camel/quarkus/component/aws2/cw/it/Aws2CwTestEnvCustomizer.java
@@ -23,7 +23,7 @@ import org.apache.camel.quarkus.test.support.aws2.Service;
public class Aws2CwTestEnvCustomizer implements Aws2TestEnvCustomizer {
@Override
- public Service[] localstackServices() {
+ public Service[] awsServices() {
return new Service[] { Service.CLOUDWATCH };
}
diff --git
a/integration-test-groups/aws2/aws2-ddb/src/test/java/org/apache/camel/quarkus/component/aws2/ddb/it/Aws2DdbTestEnvCustomizer.java
b/integration-test-groups/aws2/aws2-ddb/src/test/java/org/apache/camel/quarkus/component/aws2/ddb/it/Aws2DdbTestEnvCustomizer.java
index 4cc590df79..4870a86c7a 100644
---
a/integration-test-groups/aws2/aws2-ddb/src/test/java/org/apache/camel/quarkus/component/aws2/ddb/it/Aws2DdbTestEnvCustomizer.java
+++
b/integration-test-groups/aws2/aws2-ddb/src/test/java/org/apache/camel/quarkus/component/aws2/ddb/it/Aws2DdbTestEnvCustomizer.java
@@ -41,7 +41,7 @@ import
software.amazon.awssdk.services.dynamodb.waiters.DynamoDbWaiter;
public class Aws2DdbTestEnvCustomizer implements Aws2TestEnvCustomizer {
@Override
- public Service[] localstackServices() {
+ public Service[] awsServices() {
return new Service[] { Service.DYNAMODB, Service.DYNAMODB_STREAMS };
}
diff --git a/integration-test-groups/aws2/aws2-ec2/README.adoc
b/integration-test-groups/aws2/aws2-ec2/README.adoc
index 6581273278..4cffb7455a 100644
--- a/integration-test-groups/aws2/aws2-ec2/README.adoc
+++ b/integration-test-groups/aws2/aws2-ec2/README.adoc
@@ -1,6 +1,6 @@
= AWS EC2 tests
-By default, the integration tests run against a LocalStack container.
+By default, the integration tests run against a Floci container.
== Running against real AWS
diff --git
a/integration-test-groups/aws2/aws2-ec2/src/test/java/org/apache/camel/quarkus/component/aws2/ec2/it/Aws2Ec2TestEnvCustomizer.java
b/integration-test-groups/aws2/aws2-ec2/src/test/java/org/apache/camel/quarkus/component/aws2/ec2/it/Aws2Ec2TestEnvCustomizer.java
index 6aaca7fd3b..972bd5b3eb 100644
---
a/integration-test-groups/aws2/aws2-ec2/src/test/java/org/apache/camel/quarkus/component/aws2/ec2/it/Aws2Ec2TestEnvCustomizer.java
+++
b/integration-test-groups/aws2/aws2-ec2/src/test/java/org/apache/camel/quarkus/component/aws2/ec2/it/Aws2Ec2TestEnvCustomizer.java
@@ -23,7 +23,7 @@ import org.apache.camel.quarkus.test.support.aws2.Service;
public class Aws2Ec2TestEnvCustomizer implements Aws2TestEnvCustomizer {
@Override
- public Service[] localstackServices() {
+ public Service[] awsServices() {
return new Service[] { Service.EC2 };
}
diff --git a/integration-test-groups/aws2/aws2-ecs/README.adoc
b/integration-test-groups/aws2/aws2-ecs/README.adoc
index 232397eac7..5f9d59891b 100644
--- a/integration-test-groups/aws2/aws2-ecs/README.adoc
+++ b/integration-test-groups/aws2/aws2-ecs/README.adoc
@@ -2,7 +2,7 @@
By default the tests run in WireMock playback mode using pre-recorded mappings
from `src/test/resources/mappings/`.
-NOTE: Amazon ECS is not supported by LocalStack community version, so the
`Aws2TestEnvCustomizer` SPI (used by other AWS modules to start a LocalStack
container) cannot be used here. WireMock is used instead to simulate the ECS
API in the default (non-real AWS) test mode.
+NOTE: Amazon ECS is not supported by Floci, so the `Aws2TestEnvCustomizer` SPI
(used by other AWS modules to start a Floci container) cannot be used here.
WireMock is used instead to simulate the ECS API in the default (non-real AWS)
test mode.
NOTE: WireMock recording mode is not supported for AWS services. When WireMock
acts as an HTTPS reverse proxy (required for endpoint override), it modifies
request headers which breaks AWS SigV4 signature validation.
diff --git a/integration-test-groups/aws2/aws2-iam/README.adoc
b/integration-test-groups/aws2/aws2-iam/README.adoc
index 96ef43a5f0..27ce5a92b2 100644
--- a/integration-test-groups/aws2/aws2-iam/README.adoc
+++ b/integration-test-groups/aws2/aws2-iam/README.adoc
@@ -1,6 +1,6 @@
= AWS IAM tests
-By default the tests run against a LocalStack container via the
`Aws2TestEnvCustomizer` SPI.
+By default the tests run against a Floci container via the
`Aws2TestEnvCustomizer` SPI.
== Running against real AWS
diff --git
a/integration-test-groups/aws2/aws2-iam/src/test/java/org/apache/camel/quarkus/component/aws2/iam/it/Aws2IamTestEnvCustomizer.java
b/integration-test-groups/aws2/aws2-iam/src/test/java/org/apache/camel/quarkus/component/aws2/iam/it/Aws2IamTestEnvCustomizer.java
index e71b9ab7f1..d59dfe2330 100644
---
a/integration-test-groups/aws2/aws2-iam/src/test/java/org/apache/camel/quarkus/component/aws2/iam/it/Aws2IamTestEnvCustomizer.java
+++
b/integration-test-groups/aws2/aws2-iam/src/test/java/org/apache/camel/quarkus/component/aws2/iam/it/Aws2IamTestEnvCustomizer.java
@@ -23,7 +23,7 @@ import org.apache.camel.quarkus.test.support.aws2.Service;
public class Aws2IamTestEnvCustomizer implements Aws2TestEnvCustomizer {
@Override
- public Service[] localstackServices() {
+ public Service[] awsServices() {
return new Service[] { Service.IAM };
}
diff --git
a/integration-test-groups/aws2/aws2-kinesis/src/test/java/org/apache/camel/quarkus/component/aws2/kinesis/it/Aws2KinesisTestEnvCustomizer.java
b/integration-test-groups/aws2/aws2-kinesis/src/test/java/org/apache/camel/quarkus/component/aws2/kinesis/it/Aws2KinesisTestEnvCustomizer.java
index 5638d55eee..15336f2e25 100644
---
a/integration-test-groups/aws2/aws2-kinesis/src/test/java/org/apache/camel/quarkus/component/aws2/kinesis/it/Aws2KinesisTestEnvCustomizer.java
+++
b/integration-test-groups/aws2/aws2-kinesis/src/test/java/org/apache/camel/quarkus/component/aws2/kinesis/it/Aws2KinesisTestEnvCustomizer.java
@@ -66,12 +66,12 @@ public class Aws2KinesisTestEnvCustomizer implements
Aws2TestEnvCustomizer {
private static final Logger LOG =
Logger.getLogger(Aws2KinesisTestEnvCustomizer.class);
@Override
- public Service[] localstackServices() {
+ public Service[] awsServices() {
return new Service[] { Service.KINESIS, Service.FIREHOSE, Service.S3,
Service.IAM, Service.STS };
}
@Override
- public Service[] exportCredentialsForLocalstackServices() {
+ public Service[] exportCredentialsForMockServices() {
return new Service[] { Service.KINESIS, Service.FIREHOSE };
}
diff --git
a/integration-test-groups/aws2/aws2-kms/src/test/java/org/apache/camel/quarkus/component/aws2/kms/it/Aws2KmsTestEnvCustomizer.java
b/integration-test-groups/aws2/aws2-kms/src/test/java/org/apache/camel/quarkus/component/aws2/kms/it/Aws2KmsTestEnvCustomizer.java
index a05fa30dba..c619ec853c 100644
---
a/integration-test-groups/aws2/aws2-kms/src/test/java/org/apache/camel/quarkus/component/aws2/kms/it/Aws2KmsTestEnvCustomizer.java
+++
b/integration-test-groups/aws2/aws2-kms/src/test/java/org/apache/camel/quarkus/component/aws2/kms/it/Aws2KmsTestEnvCustomizer.java
@@ -23,7 +23,7 @@ import org.apache.camel.quarkus.test.support.aws2.Service;
public class Aws2KmsTestEnvCustomizer implements Aws2TestEnvCustomizer {
@Override
- public Service[] localstackServices() {
+ public Service[] awsServices() {
return new Service[] { Service.KMS };
}
diff --git
a/integration-test-groups/aws2/aws2-lambda/src/test/java/org/apache/camel/quarkus/component/aws2/lambda/it/Aws2LambdaTest.java
b/integration-test-groups/aws2/aws2-lambda/src/test/java/org/apache/camel/quarkus/component/aws2/lambda/it/Aws2LambdaTest.java
index b6491c0c1f..87514b4fea 100644
---
a/integration-test-groups/aws2/aws2-lambda/src/test/java/org/apache/camel/quarkus/component/aws2/lambda/it/Aws2LambdaTest.java
+++
b/integration-test-groups/aws2/aws2-lambda/src/test/java/org/apache/camel/quarkus/component/aws2/lambda/it/Aws2LambdaTest.java
@@ -37,8 +37,6 @@ import org.jboss.logging.Logger;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.DisabledOnOs;
-import org.junit.jupiter.api.condition.OS;
import static org.awaitility.Awaitility.await;
import static org.hamcrest.Matchers.emptyOrNullString;
@@ -47,7 +45,6 @@ import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.junit.jupiter.api.Assertions.assertNotNull;
-@DisabledOnOs(value = OS.MAC, disabledReason = "Requires /var/run/docker.sock
mount")
@QuarkusTest
@QuarkusTestResource(Aws2TestResource.class)
class Aws2LambdaTest extends BaseAWs2TestSupport {
diff --git
a/integration-test-groups/aws2/aws2-lambda/src/test/java/org/apache/camel/quarkus/component/aws2/lambda/it/Aws2LambdaTestEnvCustomizer.java
b/integration-test-groups/aws2/aws2-lambda/src/test/java/org/apache/camel/quarkus/component/aws2/lambda/it/Aws2LambdaTestEnvCustomizer.java
index 8b0ccd497e..a97c55b15b 100644
---
a/integration-test-groups/aws2/aws2-lambda/src/test/java/org/apache/camel/quarkus/component/aws2/lambda/it/Aws2LambdaTestEnvCustomizer.java
+++
b/integration-test-groups/aws2/aws2-lambda/src/test/java/org/apache/camel/quarkus/component/aws2/lambda/it/Aws2LambdaTestEnvCustomizer.java
@@ -39,12 +39,12 @@ import
software.amazon.awssdk.services.sqs.model.QueueAttributeName;
public class Aws2LambdaTestEnvCustomizer implements Aws2TestEnvCustomizer {
@Override
- public Service[] localstackServices() {
+ public Service[] awsServices() {
return new Service[] { Service.LAMBDA, Service.IAM, Service.SQS };
}
@Override
- public Service[] exportCredentialsForLocalstackServices() {
+ public Service[] exportCredentialsForMockServices() {
return new Service[] { Service.LAMBDA };
}
diff --git a/integration-test-groups/aws2/aws2-mq/README.adoc
b/integration-test-groups/aws2/aws2-mq/README.adoc
index f61ee35a04..e0a3c5512c 100644
--- a/integration-test-groups/aws2/aws2-mq/README.adoc
+++ b/integration-test-groups/aws2/aws2-mq/README.adoc
@@ -2,7 +2,7 @@
By default the tests run in WireMock playback mode using pre-recorded mappings
from `src/test/resources/mappings/`.
-NOTE: Amazon MQ is not supported by LocalStack community version, so the
`Aws2TestEnvCustomizer` SPI (used by other AWS modules to start a LocalStack
container) cannot be used here. WireMock is used instead to simulate the MQ API
in the default (non-real AWS) test mode.
+NOTE: Amazon MQ is not supported by Floci, so the `Aws2TestEnvCustomizer` SPI
(used by other AWS modules to start a Floci container) cannot be used here.
WireMock is used instead to simulate the MQ API in the default (non-real AWS)
test mode.
== Running against real AWS
diff --git a/integration-test-groups/aws2/aws2-msk/README.adoc
b/integration-test-groups/aws2/aws2-msk/README.adoc
index a8a389ee43..6176653c6b 100644
--- a/integration-test-groups/aws2/aws2-msk/README.adoc
+++ b/integration-test-groups/aws2/aws2-msk/README.adoc
@@ -2,7 +2,7 @@
By default the tests run in WireMock playback mode using pre-recorded mappings
from `src/test/resources/mappings/`.
-NOTE: Amazon MSK is not supported by LocalStack community version, so the
`Aws2TestEnvCustomizer` SPI (used by other AWS modules to start a LocalStack
container) cannot be used here. WireMock is used instead to simulate the MSK
API in the default (non-real AWS) test mode.
+NOTE: Amazon MSK is not supported by Floci, so the `Aws2TestEnvCustomizer` SPI
(used by other AWS modules to start a Floci container) cannot be used here.
WireMock is used instead to simulate the MSK API in the default (non-real AWS)
test mode.
== Running against real AWS
diff --git
a/integration-test-groups/aws2/aws2-s3/src/test/java/org/apache/camel/quarkus/component/aws2/s3/it/Aws2S3TestEnvCustomizer.java
b/integration-test-groups/aws2/aws2-s3/src/test/java/org/apache/camel/quarkus/component/aws2/s3/it/Aws2S3TestEnvCustomizer.java
index be0344f568..0d6962b70d 100644
---
a/integration-test-groups/aws2/aws2-s3/src/test/java/org/apache/camel/quarkus/component/aws2/s3/it/Aws2S3TestEnvCustomizer.java
+++
b/integration-test-groups/aws2/aws2-s3/src/test/java/org/apache/camel/quarkus/component/aws2/s3/it/Aws2S3TestEnvCustomizer.java
@@ -31,7 +31,7 @@ import
software.amazon.awssdk.services.s3.model.DeleteBucketRequest;
public class Aws2S3TestEnvCustomizer implements Aws2TestEnvCustomizer {
@Override
- public Service[] localstackServices() {
+ public Service[] awsServices() {
return new Service[] { Service.S3, Service.KMS };
}
@@ -46,7 +46,7 @@ public class Aws2S3TestEnvCustomizer implements
Aws2TestEnvCustomizer {
envContext.property("aws-s3.bucket-name", bucketName);
envContext.closeable(() ->
s3Client.deleteBucket(DeleteBucketRequest.builder().bucket(bucketName).build()));
- if (envContext.isLocalStack()) {
+ if (envContext.isMockBackend()) {
final String kmsKeyId =
kmsClient.createKey(CreateKeyRequest.builder().description("Test_key").build())
.keyMetadata().keyId();
envContext.property("aws-s3.kms-key-id", kmsKeyId);
diff --git
a/integration-test-groups/aws2/aws2-ses/src/test/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesIT.java
b/integration-test-groups/aws2/aws2-ses/src/test/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesIT.java
index 5f2258830c..66ac327e62 100644
---
a/integration-test-groups/aws2/aws2-ses/src/test/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesIT.java
+++
b/integration-test-groups/aws2/aws2-ses/src/test/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesIT.java
@@ -19,8 +19,7 @@ package org.apache.camel.quarkus.component.aws2.ses.it;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
-/* Disabled on Localstack because Localstack does not send e-mails which we do
assume in our tests
- * See
https://github.com/localstack/localstack/issues/339#issuecomment-341727758 */
+/* Disabled on mock backend because it does not send e-mails which we do
assume in our tests */
@EnabledIfEnvironmentVariable(named = "AWS_ACCESS_KEY", matches =
"[a-zA-Z0-9]+")
@EnabledIfEnvironmentVariable(named = "MAILSLURP_API_KEY", matches =
"[a-zA-Z0-9]+")
@QuarkusIntegrationTest
diff --git
a/integration-test-groups/aws2/aws2-ses/src/test/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesTest.java
b/integration-test-groups/aws2/aws2-ses/src/test/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesTest.java
index 3d6454c94d..76aba63e3b 100644
---
a/integration-test-groups/aws2/aws2-ses/src/test/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesTest.java
+++
b/integration-test-groups/aws2/aws2-ses/src/test/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesTest.java
@@ -52,8 +52,7 @@ import
software.amazon.awssdk.services.ses.model.VerifyEmailAddressRequest;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.fail;
-/* Disabled on Localstack because Localstack does not send e-mails which we do
assume in our tests
- * See
https://github.com/localstack/localstack/issues/339#issuecomment-341727758 */
+/* Disabled on mock backend because it does not send e-mails which we do
assume in our tests */
@EnabledIfEnvironmentVariable(named = "AWS_ACCESS_KEY", matches =
"[a-zA-Z0-9]+")
@EnabledIfEnvironmentVariable(named = "MAILSLURP_API_KEY", matches =
"[a-zA-Z0-9]+")
@QuarkusTest
diff --git
a/integration-test-groups/aws2/aws2-ses/src/test/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesTestEnvCustomizer.java
b/integration-test-groups/aws2/aws2-ses/src/test/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesTestEnvCustomizer.java
index ee365f219a..c83e1dc752 100644
---
a/integration-test-groups/aws2/aws2-ses/src/test/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesTestEnvCustomizer.java
+++
b/integration-test-groups/aws2/aws2-ses/src/test/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesTestEnvCustomizer.java
@@ -23,7 +23,7 @@ import org.apache.camel.quarkus.test.support.aws2.Service;
public class Aws2SesTestEnvCustomizer implements Aws2TestEnvCustomizer {
@Override
- public Service[] localstackServices() {
+ public Service[] awsServices() {
return new Service[] { Service.SES };
}
diff --git
a/integration-test-groups/aws2/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sns/it/Aws2SqsSnsTest.java
b/integration-test-groups/aws2/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sns/it/Aws2SqsSnsTest.java
index d84842bd5e..d8b7b64aa1 100644
---
a/integration-test-groups/aws2/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sns/it/Aws2SqsSnsTest.java
+++
b/integration-test-groups/aws2/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sns/it/Aws2SqsSnsTest.java
@@ -23,7 +23,7 @@ import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
-import org.apache.camel.quarkus.test.support.aws2.Aws2LocalStack;
+import org.apache.camel.quarkus.test.support.aws2.Aws2MockBackend;
import org.apache.camel.quarkus.test.support.aws2.Aws2TestResource;
import org.apache.camel.quarkus.test.support.aws2.BaseAWs2TestSupport;
import org.eclipse.microprofile.config.ConfigProvider;
@@ -46,8 +46,8 @@ class Aws2SqsSnsTest extends BaseAWs2TestSupport {
return ConfigProvider.getConfig().getValue("aws-sqs.queue-name",
String.class);
}
- @Aws2LocalStack
- private boolean localStack;
+ @Aws2MockBackend
+ private boolean mockBackend;
@AfterEach
public void purgeQueueAndWait() {
@@ -56,7 +56,7 @@ class Aws2SqsSnsTest extends BaseAWs2TestSupport {
// purge takes up to 60 seconds
// all messages delivered within those 60 seconds might get deleted
try {
- if (!localStack) {
+ if (!mockBackend) {
TimeUnit.SECONDS.sleep(60);
}
} catch (InterruptedException ignored) {
diff --git
a/integration-test-groups/aws2/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sns/it/Aws2SqsSnsTestEnvCustomizer.java
b/integration-test-groups/aws2/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sns/it/Aws2SqsSnsTestEnvCustomizer.java
index 28566ac1a6..c26d4b6a55 100644
---
a/integration-test-groups/aws2/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sns/it/Aws2SqsSnsTestEnvCustomizer.java
+++
b/integration-test-groups/aws2/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sns/it/Aws2SqsSnsTestEnvCustomizer.java
@@ -42,7 +42,7 @@ import static java.util.Map.entry;
public class Aws2SqsSnsTestEnvCustomizer implements Aws2TestEnvCustomizer {
@Override
- public Service[] localstackServices() {
+ public Service[] awsServices() {
return new Service[] { Service.SQS, Service.SNS };
}
diff --git
a/integration-test-groups/aws2/aws2-sqs/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsTest.java
b/integration-test-groups/aws2/aws2-sqs/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsTest.java
index 0a52cae001..888a2bed42 100644
---
a/integration-test-groups/aws2/aws2-sqs/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsTest.java
+++
b/integration-test-groups/aws2/aws2-sqs/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsTest.java
@@ -34,7 +34,7 @@ import io.restassured.RestAssured;
import io.restassured.http.ContentType;
import io.restassured.response.ExtractableResponse;
import io.restassured.response.Response;
-import org.apache.camel.quarkus.test.support.aws2.Aws2LocalStack;
+import org.apache.camel.quarkus.test.support.aws2.Aws2MockBackend;
import org.apache.camel.quarkus.test.support.aws2.Aws2TestResource;
import org.apache.camel.quarkus.test.support.aws2.BaseAWs2TestSupport;
import org.apache.commons.lang3.RandomStringUtils;
@@ -56,8 +56,8 @@ class Aws2SqsTest extends BaseAWs2TestSupport {
private static final Logger LOG = Logger.getLogger(Aws2SqsTest.class);
- @Aws2LocalStack
- private boolean localStack;
+ @Aws2MockBackend
+ private boolean mockBackend;
public Aws2SqsTest() {
super("/aws2-sqs");
@@ -95,7 +95,7 @@ class Aws2SqsTest extends BaseAWs2TestSupport {
// purge takes up to 60 seconds
// all messages delivered within those 60 seconds might get deleted
try {
- if (!localStack) {
+ if (!mockBackend) {
TimeUnit.SECONDS.sleep(60);
}
} catch (InterruptedException ignored) {
@@ -294,7 +294,7 @@ class Aws2SqsTest extends BaseAWs2TestSupport {
@Test
void sqsKmsEncryption() {
- Assumptions.assumeTrue(localStack, "KMS test only runs on LocalStack");
+ Assumptions.assumeTrue(mockBackend, "KMS test only runs on mock
backend");
final String kmsQueueName = "camel-quarkus-kms-"
+
RandomStringUtils.secure().nextAlphanumeric(10).toLowerCase(Locale.ROOT);
diff --git
a/integration-test-groups/aws2/aws2-sqs/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsTestEnvCustomizer.java
b/integration-test-groups/aws2/aws2-sqs/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsTestEnvCustomizer.java
index f4aa714a06..00171e714d 100644
---
a/integration-test-groups/aws2/aws2-sqs/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsTestEnvCustomizer.java
+++
b/integration-test-groups/aws2/aws2-sqs/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsTestEnvCustomizer.java
@@ -33,12 +33,12 @@ import
software.amazon.awssdk.services.sqs.model.QueueDoesNotExistException;
public class Aws2SqsTestEnvCustomizer implements Aws2TestEnvCustomizer {
@Override
- public Service[] localstackServices() {
+ public Service[] awsServices() {
return new Service[] { Service.SQS, Service.KMS };
}
@Override
- public Service[] exportCredentialsForLocalstackServices() {
+ public Service[] exportCredentialsForMockServices() {
return new Service[] { Service.SQS };
}
@@ -97,7 +97,7 @@ public class Aws2SqsTestEnvCustomizer implements
Aws2TestEnvCustomizer {
.build())
.queueUrl();
- if (envContext.isLocalStack()) {
+ if (envContext.isMockBackend()) {
final KmsClient kmsClient = envContext.client(Service.KMS,
KmsClient::builder);
final String kmsKeyId = kmsClient
.createKey(CreateKeyRequest.builder().description("camel-quarkus-sqs-test").build())
diff --git a/integration-tests-support/aws2/pom.xml
b/integration-tests-support/aws2/pom.xml
index d405ae6f91..c5f4ecbaeb 100644
--- a/integration-tests-support/aws2/pom.xml
+++ b/integration-tests-support/aws2/pom.xml
@@ -62,13 +62,17 @@
<groupId>software.amazon.awssdk</groupId>
<artifactId>auth</artifactId>
</dependency>
+ <dependency>
+ <groupId>software.amazon.awssdk</groupId>
+ <artifactId>s3</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-integration-test-support</artifactId>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
- <artifactId>testcontainers-localstack</artifactId>
+ <artifactId>testcontainers</artifactId>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
diff --git
a/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2LocalStack.java
b/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2MockBackend.java
similarity index 96%
copy from
integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2LocalStack.java
copy to
integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2MockBackend.java
index 09fa1e8544..b693907b35 100644
---
a/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2LocalStack.java
+++
b/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2MockBackend.java
@@ -23,6 +23,6 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
-public @interface Aws2LocalStack {
+public @interface Aws2MockBackend {
}
diff --git
a/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2TestEnvContext.java
b/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2TestEnvContext.java
index 7a5ffc71d4..ea96bbe7c8 100644
---
a/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2TestEnvContext.java
+++
b/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2TestEnvContext.java
@@ -30,13 +30,14 @@ import java.util.Optional;
import java.util.function.Supplier;
import org.jboss.logging.Logger;
-import org.testcontainers.localstack.LocalStackContainer;
+import org.testcontainers.containers.GenericContainer;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.awscore.client.builder.AwsClientBuilder;
import software.amazon.awssdk.core.SdkClient;
import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.s3.S3ClientBuilder;
/**
* A context passed to {@link
Aws2TestEnvCustomizer#customize(Aws2TestEnvContext)}.
@@ -54,20 +55,20 @@ public class Aws2TestEnvContext {
private final String accessKey;
private final String secretKey;
private final String region;
- private final Optional<LocalStackContainer> localstack;
+ private final Optional<GenericContainer<?>> floci;
private final CredentialsProvider credentialsProvider;
public Aws2TestEnvContext(String accessKey, String secretKey, String
region, boolean useDefaultCredentialsProvider,
- Optional<LocalStackContainer> localstack,
+ Optional<GenericContainer<?>> floci,
Service[] exportCredentialsServices) {
this.accessKey = accessKey;
this.secretKey = secretKey;
this.region = region;
- this.localstack = localstack;
+ this.floci = floci;
this.credentialsProvider = useDefaultCredentialsProvider ?
CredentialsProvider.defaultProvider
: CredentialsProvider.staticProvider;
- localstack.ifPresent(ls -> {
+ floci.ifPresent(fc -> {
for (Service service : exportCredentialsServices) {
String s = camelServiceComponentName(service);
if (s != null) {
@@ -79,7 +80,12 @@ public class Aws2TestEnvContext {
properties.put(s + ".override-endpoint", "true");
properties.put(s + ".uri-endpoint-override",
- ls.getEndpoint().toString());
+ String.format("http://%s:%d", fc.getHost(),
fc.getMappedPort(Aws2TestResource.FLOCI_PORT)));
+
+ // S3 requires path-style access with Floci to avoid
virtual-host DNS issues
+ if (service == Service.S3) {
+ properties.put(s + ".force-path-style", "true");
+ }
}
}
});
@@ -156,8 +162,8 @@ public class Aws2TestEnvContext {
}
}
- if (localstack.isPresent()) {
- localstack.get().stop();
+ if (floci.isPresent()) {
+ floci.get().stop();
}
}
@@ -180,10 +186,19 @@ public class Aws2TestEnvContext {
:
StaticCredentialsProvider.create(AwsBasicCredentials.create(accessKey,
secretKey)));
builder.region(Region.of(region));
- if (localstack.isPresent()) {
+ if (floci.isPresent()) {
+ GenericContainer<?> container = floci.get();
+ URI endpoint = URI.create(String.format("http://%s:%d",
+ container.getHost(),
+ container.getMappedPort(Aws2TestResource.FLOCI_PORT)));
builder
- .endpointOverride(localstack.get().getEndpoint())
+ .endpointOverride(endpoint)
.region(Region.of(region));
+
+ // S3 requires path-style access with Floci to avoid virtual-host
DNS issues
+ if (builder instanceof S3ClientBuilder s3Builder) {
+ s3Builder.forcePathStyle(true);
+ }
} else if (service == Service.IAM) {
/* Avoid UnknownHostException: iam.eu-central-1.amazonaws.com */
builder.endpointOverride(URI.create("https://iam.amazonaws.com"));
@@ -240,8 +255,8 @@ public class Aws2TestEnvContext {
return secretKey;
}
- public boolean isLocalStack() {
- return localstack.isPresent();
+ public boolean isMockBackend() {
+ return floci.isPresent();
}
public boolean isUseDefaultCredentialsProvider() {
diff --git
a/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2TestEnvCustomizer.java
b/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2TestEnvCustomizer.java
index efe618d178..bfbdccd44b 100644
---
a/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2TestEnvCustomizer.java
+++
b/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2TestEnvCustomizer.java
@@ -23,15 +23,18 @@ package org.apache.camel.quarkus.test.support.aws2;
public interface Aws2TestEnvCustomizer {
/**
- * @return an array of services the Localstack container should expose
+ * @return an array of services the mock backend (Floci) container should
provide
*/
- Service[] localstackServices();
+ default Service[] awsServices() {
+ return new Service[0];
+ }
/**
- * @return an array of Localstack services for which {@link
Aws2TestEnvContext} should export credentials properties
+ * @return an array of mock backend services for which {@link
Aws2TestEnvContext} should export credentials
+ * properties
*/
- default Service[] exportCredentialsForLocalstackServices() {
- return localstackServices();
+ default Service[] exportCredentialsForMockServices() {
+ return awsServices();
}
/**
diff --git
a/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2TestResource.java
b/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2TestResource.java
index 389c493c66..ba4efa8952 100644
---
a/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2TestResource.java
+++
b/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2TestResource.java
@@ -17,6 +17,8 @@
package org.apache.camel.quarkus.test.support.aws2;
import java.lang.reflect.Field;
+import java.nio.file.Files;
+import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -29,12 +31,15 @@ import
org.apache.camel.quarkus.test.mock.backend.MockBackendUtils;
import org.eclipse.microprofile.config.ConfigProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.testcontainers.containers.BindMode;
+import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.output.Slf4jLogConsumer;
-import org.testcontainers.localstack.LocalStackContainer;
+import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.utility.DockerImageName;
import software.amazon.awssdk.core.SdkClient;
public final class Aws2TestResource implements
QuarkusTestResourceLifecycleManager {
+ static final int FLOCI_PORT = 4566;
private static final Logger LOG =
LoggerFactory.getLogger(Aws2TestResource.class);
private Aws2TestEnvContext envContext;
@@ -63,37 +68,47 @@ public final class Aws2TestResource implements
QuarkusTestResourceLifecycleManag
if (usingMockBackend) {
MockBackendUtils.logMockBackendUsed();
- String localstackLogLevel =
System.getProperty("localstack.log.level",
System.getenv("LOCALSTACK_LOG_LEVEL"));
- if (localstackLogLevel == null) {
- localstackLogLevel = "info";
- }
-
- final String[] services = customizers.stream()
- .map(Aws2TestEnvCustomizer::localstackServices)
- .flatMap(Stream::of)
- .distinct()
- .map(Service::getName)
- .toArray(String[]::new);
-
final Service[] exportCredentialsServices = customizers.stream()
-
.map(Aws2TestEnvCustomizer::exportCredentialsForLocalstackServices)
+
.map(Aws2TestEnvCustomizer::exportCredentialsForMockServices)
.flatMap(Stream::of)
.distinct()
.toArray(Service[]::new);
+ boolean needsDockerSocket = customizers.stream()
+ .map(Aws2TestEnvCustomizer::awsServices)
+ .flatMap(Stream::of)
+ .anyMatch(s -> s == Service.LAMBDA);
+
DockerImageName imageName = DockerImageName
-
.parse(ConfigProvider.getConfig().getValue("localstack.container.image",
String.class))
- .asCompatibleSubstituteFor("localstack/localstack");
- LocalStackContainer localstack = new LocalStackContainer(imageName)
- .withServices(services);
- localstack.withEnv("LS_LOG", localstackLogLevel);
- localstack.withEnv("AWS_ACCESS_KEY_ID", "testAccessKeyId"); //has
to be longer then `test`, to work on FIPS systems
- localstack.withEnv("AWS_SECRET_ACCESS_KEY", "testSecretKeyId");
- localstack.withLogConsumer(new Slf4jLogConsumer(LOG));
- localstack.start();
-
- envContext = new Aws2TestEnvContext(localstack.getAccessKey(),
localstack.getSecretKey(), localstack.getRegion(),
- useDefaultCredentialsProvider, Optional.of(localstack),
exportCredentialsServices);
+
.parse(ConfigProvider.getConfig().getValue("floci.container.image",
String.class));
+
+ GenericContainer<?> floci = new GenericContainer<>(imageName)
+ .withExposedPorts(FLOCI_PORT)
+
.waitingFor(Wait.forHttp("/_floci/health").forPort(FLOCI_PORT))
+ .withEnv("AWS_ACCESS_KEY_ID", "testAccessKeyId") //has to
be longer then `test`, to work on FIPS systems
+ .withEnv("AWS_SECRET_ACCESS_KEY", "testSecretKeyId")
+ .withLogConsumer(new Slf4jLogConsumer(LOG));
+
+ if (needsDockerSocket) {
+ Path dockerSocket = Path.of("/var/run/docker.sock");
+ if (Files.exists(dockerSocket)) {
+ floci.withFileSystemBind(dockerSocket.toString(),
"/var/run/docker.sock", BindMode.READ_WRITE)
+ .withPrivilegedMode(true);
+ } else {
+ LOG.warn("Docker socket not found at {}. Lambda container
execution will not be available.",
+ dockerSocket);
+ }
+ }
+
+ String logLevel = System.getProperty("floci.log.level",
System.getenv("FLOCI_LOG_LEVEL"));
+ if (logLevel != null) {
+ floci.withEnv("QUARKUS_LOG_LEVEL", logLevel);
+ }
+
+ floci.start();
+
+ envContext = new Aws2TestEnvContext(getAccessKey(),
getSecretKey(), getRegion(),
+ useDefaultCredentialsProvider, Optional.of(floci),
exportCredentialsServices);
} else {
if (!startMockBackend && !realCredentialsProvided &&
!useDefaultCredentialsProvider) {
@@ -135,11 +150,11 @@ public final class Aws2TestResource implements
QuarkusTestResourceLifecycleManag
throw new RuntimeException("Could not set " +
c.getName() + "." + f.getName(), e);
}
}
- Aws2LocalStack localStackAnnot =
f.getAnnotation(Aws2LocalStack.class);
- if (localStackAnnot != null) {
+ Aws2MockBackend mockBackendAnnot =
f.getAnnotation(Aws2MockBackend.class);
+ if (mockBackendAnnot != null) {
f.setAccessible(true);
try {
- f.set(testInstance, envContext.isLocalStack());
+ f.set(testInstance, envContext.isMockBackend());
} catch (IllegalArgumentException | IllegalAccessException
e) {
throw new RuntimeException("Could not set " +
c.getName() + "." + f.getName(), e);
}
@@ -149,4 +164,16 @@ public final class Aws2TestResource implements
QuarkusTestResourceLifecycleManag
}
}
+ private String getAccessKey() {
+ return "testAccessKeyId";
+ }
+
+ private String getSecretKey() {
+ return "testSecretKeyId";
+ }
+
+ private String getRegion() {
+ return "us-east-1";
+ }
+
}
diff --git
a/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2LocalStack.java
b/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/DockerSocketAvailable.java
similarity index 75%
rename from
integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2LocalStack.java
rename to
integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/DockerSocketAvailable.java
index 09fa1e8544..00e82fa496 100644
---
a/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2LocalStack.java
+++
b/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/DockerSocketAvailable.java
@@ -16,13 +16,13 @@
*/
package org.apache.camel.quarkus.test.support.aws2;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.FIELD)
-public @interface Aws2LocalStack {
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.function.BooleanSupplier;
+public class DockerSocketAvailable implements BooleanSupplier {
+ @Override
+ public boolean getAsBoolean() {
+ return Files.exists(Path.of("/var/run/docker.sock"));
+ }
}
diff --git a/integration-tests-support/debezium/pom.xml
b/integration-tests-support/debezium/pom.xml
index 5de7cb70dc..a6e1cf9727 100644
--- a/integration-tests-support/debezium/pom.xml
+++ b/integration-tests-support/debezium/pom.xml
@@ -64,7 +64,7 @@
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
- <artifactId>testcontainers-localstack</artifactId>
+ <artifactId>testcontainers</artifactId>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
diff --git a/pom.xml b/pom.xml
index a965dccefb..4736348ad7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -254,6 +254,7 @@
<fhir.container.image.base>mirror.gcr.io/hapiproject/hapi</fhir.container.image.base>
<fhir.container.image>${fhir.container.image.base}:v8.6.0-1</fhir.container.image>
<fhir-dstu.container.image>${fhir.container.image.base}:v4.2.0</fhir-dstu.container.image>
+
<floci.container.image>mirror.gcr.io/floci/floci:1.5.28</floci.container.image>
<google-cloud-sdk.container.image>gcr.io/google.com/cloudsdktool/cloud-sdk:551.0.0-emulators</google-cloud-sdk.container.image>
<google-storage.container.image>mirror.gcr.io/fsouza/fake-gcs-server:1.52.3</google-storage.container.image>
<greenmail.container.image>mirror.gcr.io/greenmail/standalone:2.1.8</greenmail.container.image>
@@ -264,7 +265,6 @@
<kafka.container.image>quay.io/strimzi-test-container/test-container:0.114.0-kafka-4.1.0</kafka.container.image>
<keycloak.container.image>quay.io/keycloak/keycloak:${keycloak.version}</keycloak.container.image>
<kudu.container.image>mirror.gcr.io/apache/kudu:1.18.0-ubuntu</kudu.container.image>
-
<localstack.container.image>mirror.gcr.io/localstack/localstack:4.13.0</localstack.container.image>
<lra-coordinator.container.image>quay.io/jbosstm/lra-coordinator:7.0.1.Final-3.8.3</lra-coordinator.container.image>
<mariadb.container.image>mirror.gcr.io/mariadb:12.2-ubi</mariadb.container.image>
<milvus.container.image>mirror.gcr.io/milvusdb/milvus:v2.3.9</milvus.container.image>
diff --git a/poms/bom-test/pom.xml b/poms/bom-test/pom.xml
index f3a8ed32b3..34678da7ae 100644
--- a/poms/bom-test/pom.xml
+++ b/poms/bom-test/pom.xml
@@ -118,7 +118,7 @@
<groupId>org.apache.camel.quarkus</groupId>
</exclusion>
<exclusion>
- <artifactId>localstack</artifactId>
+ <artifactId>testcontainers</artifactId>
<groupId>org.testcontainers</groupId>
</exclusion>
<exclusion>