Skip to content

Commit 34dd734

Browse files
oscerdclaude
andauthored
chore: Migrate AWS tests from LocalStack to Floci and add sink tests (#2913)
* chore: Migrate AWS tests from LocalStack to Floci and add sink tests LocalStack's community edition was sunset in March 2026, now requiring auth tokens. This migrates all AWS integration tests to use Floci, the MIT-licensed drop-in replacement, via Citrus's native floci support in citrus-testcontainers. Also migrates all Pipe-format integration definitions to Camel route YAML format (issue #2873) and adds new Citrus integration tests for aws-s3-sink, aws-sqs-sink, and aws-sns-sink kamelets. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Andrea Cosentino <ancosen@gmail.com> * fix: Add camel-aws2-sns test dependency for SNS sink test The SNS sink test Groovy script imports SnsClient which requires the camel-aws2-sns dependency on the test classpath. Without it, all AWS tests fail with ClassNotFoundException. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Andrea Cosentino <ancosen@gmail.com> --------- Signed-off-by: Andrea Cosentino <ancosen@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8a8c438 commit 34dd734

39 files changed

Lines changed: 792 additions & 376 deletions

tests/camel-kamelets-itest/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@
9898
<artifactId>camel-aws2-eventbridge</artifactId>
9999
<scope>test</scope>
100100
</dependency>
101+
<dependency>
102+
<groupId>org.apache.camel</groupId>
103+
<artifactId>camel-aws2-sns</artifactId>
104+
<scope>test</scope>
105+
</dependency>
101106

102107
<!-- Citrus -->
103108
<dependency>

tests/camel-kamelets-itest/src/test/java/AwsIT.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,9 @@ public Stream<DynamicTest> awsEventBridge() {
8484
return CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("aws.eventbridge");
8585
}
8686

87+
@CitrusTestFactory
88+
public Stream<DynamicTest> awsSns() {
89+
return CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("aws.sns");
90+
}
91+
8792
}

tests/camel-kamelets-itest/src/test/resources-filtered/citrus-application.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ citrus.camel.jbang.kamelets.version=${project.version}
3232
# Enable dump of Camel JBang integration output
3333
citrus.camel.jbang.dump.integration.output=true
3434

35+
# Use Floci as the AWS emulator (drop-in replacement for LocalStack)
36+
citrus.testcontainers.localstack.image.name=floci/floci
37+
citrus.testcontainers.localstack.version=latest
38+
3539
# Use general registry mirror for Docker images (e.g. Testcontainers)
3640
citrus.testcontainers.registry.mirror=mirror.gcr.io
3741
citrus.testcontainers.registry.mirror.enabled=false

tests/camel-kamelets-itest/src/test/resources/aws/ddb/aws-ddb-sink-delete-item.citrus.it.yaml.disabled

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ variables:
2626
- name: "timer.source.period"
2727
value: "10000"
2828
actions:
29-
# Create LocalStack infrastructure
29+
# Create AWS infrastructure (Floci container)
3030
- testcontainers:
3131
start:
3232
localstack:
@@ -86,7 +86,7 @@ actions:
8686
jbang:
8787
run:
8888
integration:
89-
file: "aws/ddb/aws-ddb-sink-pipe.yaml"
89+
file: "aws/ddb/aws-ddb-sink-route.yaml"
9090
systemProperties:
9191
properties:
9292
- name: "timer.source.period"

tests/camel-kamelets-itest/src/test/resources/aws/ddb/aws-ddb-sink-put-item.citrus.it.yaml.disabled

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ variables:
2626
- name: "timer.source.period"
2727
value: "10000"
2828
actions:
29-
# Create LocalStack infrastructure
29+
# Create AWS infrastructure (Floci container)
3030
- testcontainers:
3131
start:
3232
localstack:
@@ -73,7 +73,7 @@ actions:
7373
jbang:
7474
run:
7575
integration:
76-
file: "aws/ddb/aws-ddb-sink-pipe.yaml"
76+
file: "aws/ddb/aws-ddb-sink-route.yaml"
7777
systemProperties:
7878
properties:
7979
- name: "timer.source.period"

tests/camel-kamelets-itest/src/test/resources/aws/eventbridge/aws-sqs-event-listener-pipe.yaml renamed to tests/camel-kamelets-itest/src/test/resources/aws/ddb/aws-ddb-sink-route.yaml

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,25 @@
1515
# limitations under the License.
1616
# ---------------------------------------------------------------------------
1717

18-
apiVersion: camel.apache.org/v1
19-
kind: Pipe
20-
metadata:
21-
name: aws-sqs-event-listener-pipe
22-
spec:
23-
source:
24-
ref:
25-
kind: Kamelet
26-
apiVersion: camel.apache.org/v1
27-
name: aws-sqs-source
28-
properties:
29-
queueNameOrArn: "{{aws.sqs.queueName}}"
30-
uriEndpointOverride: "{{aws.eventbridge.uriEndpointOverride}}"
31-
overrideEndpoint: "{{aws.eventbridge.overrideEndpoint}}"
32-
accessKey: "{{aws.eventbridge.accessKey}}"
33-
secretKey: "{{aws.eventbridge.secretKey}}"
34-
region: "{{aws.eventbridge.region}}"
35-
sink:
36-
ref:
37-
kind: Kamelet
38-
apiVersion: camel.apache.org/v1
39-
name: log-sink
40-
properties:
41-
showHeaders: true
18+
- route:
19+
from:
20+
uri: "timer:tick"
21+
parameters:
22+
period: "{{timer.source.period}}"
23+
repeatCount: 1
24+
steps:
25+
- setBody:
26+
constant: "{{aws.ddb.json.data}}"
27+
- log:
28+
message: "${body}"
29+
showHeaders: true
30+
- to:
31+
uri: "kamelet:aws-ddb-sink"
32+
parameters:
33+
table: "{{aws.ddb.tableName}}"
34+
operation: "{{aws.ddb.operation}}"
35+
overrideEndpoint: "{{aws.ddb.overrideEndpoint}}"
36+
uriEndpointOverride: "{{aws.ddb.uriEndpointOverride}}"
37+
accessKey: "{{aws.ddb.accessKey}}"
38+
secretKey: "{{aws.ddb.secretKey}}"
39+
region: "{{aws.ddb.region}}"

tests/camel-kamelets-itest/src/test/resources/aws/ddb/aws-ddb-sink-update-item.citrus.it.yaml.disabled

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ variables:
2626
- name: "timer.source.period"
2727
value: "10000"
2828
actions:
29-
# Create LocalStack infrastructure
29+
# Create AWS infrastructure (Floci container)
3030
- testcontainers:
3131
start:
3232
localstack:
@@ -91,7 +91,7 @@ actions:
9191
jbang:
9292
run:
9393
integration:
94-
file: "aws/ddb/aws-ddb-sink-pipe.yaml"
94+
file: "aws/ddb/aws-ddb-sink-route.yaml"
9595
systemProperties:
9696
properties:
9797
- name: "timer.source.period"

tests/camel-kamelets-itest/src/test/resources/aws/sqs/aws-sqs-uri-pipe.yaml renamed to tests/camel-kamelets-itest/src/test/resources/aws/ddb/aws-ddb-source-route.yaml

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,19 @@
1515
# limitations under the License.
1616
# ---------------------------------------------------------------------------
1717

18-
apiVersion: camel.apache.org/v1
19-
kind: Pipe
20-
metadata:
21-
name: aws-sqs-uri-pipe
22-
spec:
23-
source:
24-
ref:
25-
kind: Kamelet
26-
apiVersion: camel.apache.org/v1
27-
name: aws-sqs-source
28-
properties:
29-
queueNameOrArn: "{{aws.sqs.queueName}}"
30-
uriEndpointOverride: "{{aws.sqs.uriEndpointOverride}}"
31-
overrideEndpoint: "{{aws.sqs.overrideEndpoint}}"
32-
accessKey: "{{aws.sqs.accessKey}}"
33-
secretKey: "{{aws.sqs.secretKey}}"
34-
region: "{{aws.sqs.region}}"
35-
sink:
36-
ref:
37-
kind: Kamelet
38-
apiVersion: camel.apache.org/v1
39-
name: log-sink
40-
properties:
41-
showHeaders: true
18+
- route:
19+
from:
20+
uri: "kamelet:aws-ddb-streams-source"
21+
parameters:
22+
streamIteratorType: "FROM_START"
23+
table: "{{aws.ddb.tableName}}"
24+
overrideEndpoint: "{{aws.ddb.overrideEndpoint}}"
25+
uriEndpointOverride: "{{aws.ddb.uriEndpointOverride}}"
26+
accessKey: "{{aws.ddb.accessKey}}"
27+
secretKey: "{{aws.ddb.secretKey}}"
28+
region: "{{aws.ddb.region}}"
29+
steps:
30+
- to:
31+
uri: "kamelet:log-sink"
32+
parameters:
33+
showHeaders: true

tests/camel-kamelets-itest/src/test/resources/aws/ddb/aws-ddb-source.citrus.it.yaml.disabled

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ variables:
3030
- name: "aws.ddb.item.title"
3131
value: "Star Wars IV"
3232
actions:
33-
# Create LocalStack infrastructure
33+
# Create AWS infrastructure (Floci container)
3434
- testcontainers:
3535
start:
3636
localstack:
@@ -50,7 +50,7 @@ actions:
5050
jbang:
5151
run:
5252
integration:
53-
file: "aws/ddb/aws-ddb-source-pipe.yaml"
53+
file: "aws/ddb/aws-ddb-source-route.yaml"
5454
systemProperties:
5555
file: "aws/ddb/application.properties"
5656

@@ -62,6 +62,6 @@ actions:
6262
- camel:
6363
jbang:
6464
verify:
65-
integration: "aws-ddb-source-pipe"
65+
integration: "aws-ddb-source-route"
6666
logMessage: |
6767
"Star Wars IV"

tests/camel-kamelets-itest/src/test/resources/aws/eventbridge/aws-eventbridge-sink-pipe.yaml

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)