This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


The following commit(s) were added to refs/heads/main by this push:
     new b6c3dee7c Fix #3288: enable the disabled Kamelet tests, and no fixed 
or ephemeral ports in the Citrus tests (#3318)
b6c3dee7c is described below

commit b6c3dee7c23f39fb90d89e8b2ea504a0bde3e144
Author: Claus Ibsen <[email protected]>
AuthorDate: Sat Nov 21 13:45:28 2026 +0100

    Fix #3288: enable the disabled Kamelet tests, and no fixed or ephemeral 
ports in the Citrus tests (#3318)
    
    * Fix #3288: enable the disabled Kamelet tests, and no fixed or ephemeral 
ports in the Citrus tests
    
    - redis-sink, mqtt5-sink/-source, nats-sink/-source and cassandra-sink: the
      disabled tests are enabled, check what the Kamelet wrote or gave instead 
of a
      log line, and wait for nothing but events. The Kamelets, and the three
      Salesforce sinks whose tests came with #3305, are labelled verified.
    - azure-functions-sink: a Groovy script validation checks that 
Authorization and
      Proxy-Authorization of the message are not sent to the function
      (citrus-validation-groovy).
    - Couchbase: random host ports, advertised to the SDK as the external
      alternate addresses of the node; couchbase-source checks the row it gives.
    - ServerPorts: the HTTP servers of the tests take a port below the ephemeral
      range, once per run (the SlackIT "Address already in use" in CI).
    - Salesforce sink tests: drop the protobuf-java 4.35.1 pin (CAMEL-27260 is
      resolved, Camel manages 4.36.2).
    - google-storage-sink-storage-class-route: expect application/octet-stream, 
as
      google-storage-sink defaults to binary since #3307 (main was red).
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Claude-Session: https://claude.ai/code/session_016Y4dDmBDsSWV117kccuNf9
    
    * chore: leave the google-storage-sink storage-class test to #3322 (#3288)
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Claude-Session: https://claude.ai/code/session_016Y4dDmBDsSWV117kccuNf9
    
    * chore: check the headers azure-functions-sink sends with a Groovy action, 
not citrus-validation-groovy (#3288)
    
    citrus-validation-groovy changes how Citrus picks the validator of XML and
    binary messages, which failed 5 other tests in CI. The check now reads the
    received request from the Citrus message store.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Claude-Session: https://claude.ai/code/session_016Y4dDmBDsSWV117kccuNf9
    
    ---------
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
---
 kamelets/cassandra-sink.kamelet.yaml               |  1 +
 kamelets/mqtt5-sink.kamelet.yaml                   |  1 +
 kamelets/mqtt5-source.kamelet.yaml                 |  1 +
 kamelets/nats-sink.kamelet.yaml                    |  1 +
 kamelets/nats-source.kamelet.yaml                  |  1 +
 kamelets/redis-sink.kamelet.yaml                   |  1 +
 kamelets/salesforce-create-sink.kamelet.yaml       |  1 +
 kamelets/salesforce-delete-sink.kamelet.yaml       |  1 +
 kamelets/salesforce-update-sink.kamelet.yaml       |  1 +
 .../resources/kamelets/cassandra-sink.kamelet.yaml |  1 +
 .../resources/kamelets/mqtt5-sink.kamelet.yaml     |  1 +
 .../resources/kamelets/mqtt5-source.kamelet.yaml   |  1 +
 .../main/resources/kamelets/nats-sink.kamelet.yaml |  1 +
 .../resources/kamelets/nats-source.kamelet.yaml    |  1 +
 .../resources/kamelets/redis-sink.kamelet.yaml     |  1 +
 .../kamelets/salesforce-create-sink.kamelet.yaml   |  1 +
 .../kamelets/salesforce-delete-sink.kamelet.yaml   |  1 +
 .../kamelets/salesforce-update-sink.kamelet.yaml   |  1 +
 .../camel-kamelets-itest/src/test/java/AvroIT.java |  3 +-
 .../camel-kamelets-itest/src/test/java/AwsIT.java  |  3 +-
 .../src/test/java/AzureIT.java                     |  3 +-
 .../src/test/java/CassandraIT.java                 | 34 +++++++++
 .../src/test/java/CloudIT.java                     |  5 +-
 .../src/test/java/CommonIT.java                    |  3 +-
 .../src/test/java/CouchbaseIT.java                 |  3 +-
 .../src/test/java/DatabaseIT.java                  |  3 +-
 .../camel-kamelets-itest/src/test/java/FileIT.java |  5 +-
 .../src/test/java/GoogleCloudIT.java               |  3 +-
 .../src/test/java/InfinispanIT.java                |  3 +-
 .../camel-kamelets-itest/src/test/java/JiraIT.java |  3 +-
 .../src/test/java/KafkaIT.java                     |  3 +-
 .../camel-kamelets-itest/src/test/java/MailIT.java |  3 +-
 .../src/test/java/MessagingIT.java                 |  3 +-
 .../src/test/java/MongoIT.java                     |  3 +-
 .../src/test/java/Mqtt5IT.java                     | 45 +++++++++++
 .../camel-kamelets-itest/src/test/java/NatsIT.java | 34 +++++++++
 .../src/test/java/OpenApiIT.java                   |  3 +-
 .../src/test/java/PostgresIT.java                  |  3 +-
 .../src/test/java/ProtobufIT.java                  |  3 +-
 .../src/test/java/RedisIT.java                     |  3 +-
 .../src/test/java/SearchIT.java                    |  3 +-
 .../src/test/java/ServerPorts.java                 | 51 +++++++++++++
 .../src/test/java/ServicesIT.java                  |  3 +-
 .../src/test/java/SlackIT.java                     |  5 +-
 .../azure-functions-sink-route.citrus.it.yaml      | 11 ++-
 .../azure/azure-functions-sink-route.yaml          | 10 +++
 .../resources/azure/noCredentialHeaders.groovy     | 35 +++++++++
 ...isabled => cassandra-sink-route.citrus.it.yaml} | 43 ++++++++---
 .../resources/cassandra/cassandra-sink-route.yaml  | 12 ++-
 .../{setupKeyspace.groovy => readBack.groovy}      | 18 +++--
 .../test/resources/cassandra/setupKeyspace.groovy  |  2 +-
 .../resources/couchbase/application.properties     |  2 -
 .../couchbase/couchbase-sink-route.citrus.it.yaml  | 25 +++----
 .../resources/couchbase/couchbase-sink-route.yaml  |  1 +
 .../couchbase-source-route.citrus.it.yaml          | 52 ++++++++-----
 .../couchbase/couchbase-source-route.yaml          | 15 +++-
 .../test/resources/couchbase/initCluster.groovy    | 40 ++++++++--
 .../src/test/resources/mqtt5/mqtt5-sink-route.yaml | 20 ++++-
 ...d => mqtt5-sink-to-source-route.citrus.it.yaml} | 87 +++++++++++++++-------
 .../test/resources/mqtt5/mqtt5-source-route.yaml   | 21 +++++-
 .../src/test/resources/nats/nats-sink-route.yaml   | 13 +++-
 ...ed => nats-sink-to-source-route.citrus.it.yaml} | 54 ++++++++------
 .../src/test/resources/nats/nats-source-route.yaml | 21 +++++-
 .../src/test/resources/redis/get.groovy            | 38 ++++++++++
 ...ml.disabled => redis-sink-route.citrus.it.yaml} | 44 +++++++----
 .../src/test/resources/redis/redis-sink-route.yaml | 19 ++++-
 ...orce-composite-upsert-sink-route.citrus.it.yaml |  4 -
 .../salesforce-create-sink-route.citrus.it.yaml    |  4 -
 .../salesforce-delete-sink-route.citrus.it.yaml    |  4 -
 .../salesforce-update-sink-route.citrus.it.yaml    |  4 -
 70 files changed, 656 insertions(+), 197 deletions(-)

diff --git a/kamelets/cassandra-sink.kamelet.yaml 
b/kamelets/cassandra-sink.kamelet.yaml
index cf9899044..40418c07d 100644
--- a/kamelets/cassandra-sink.kamelet.yaml
+++ b/kamelets/cassandra-sink.kamelet.yaml
@@ -27,6 +27,7 @@ metadata:
     camel.apache.org/kamelet.namespace: "Nosql"
   labels:
     camel.apache.org/kamelet.type: "sink"
+    camel.apache.org/kamelet.verified: "true"
 spec:
   definition:
     title: "Cassandra Sink"
diff --git a/kamelets/mqtt5-sink.kamelet.yaml b/kamelets/mqtt5-sink.kamelet.yaml
index dc0bb87c5..5c378c2f8 100644
--- a/kamelets/mqtt5-sink.kamelet.yaml
+++ b/kamelets/mqtt5-sink.kamelet.yaml
@@ -27,6 +27,7 @@ metadata:
     camel.apache.org/kamelet.namespace: "Messaging"
   labels:
     camel.apache.org/kamelet.type: "sink"
+    camel.apache.org/kamelet.verified: "true"
 spec:
   definition:
     title: "MQTT v5 Sink"
diff --git a/kamelets/mqtt5-source.kamelet.yaml 
b/kamelets/mqtt5-source.kamelet.yaml
index 06cf5c333..2c9942b6a 100644
--- a/kamelets/mqtt5-source.kamelet.yaml
+++ b/kamelets/mqtt5-source.kamelet.yaml
@@ -27,6 +27,7 @@ metadata:
     camel.apache.org/kamelet.namespace: "Messaging"
   labels:
     camel.apache.org/kamelet.type: "source"
+    camel.apache.org/kamelet.verified: "true"
 spec:
   definition:
     title: "MQTT 5 Source"
diff --git a/kamelets/nats-sink.kamelet.yaml b/kamelets/nats-sink.kamelet.yaml
index 8a187b6e7..95f2dea68 100644
--- a/kamelets/nats-sink.kamelet.yaml
+++ b/kamelets/nats-sink.kamelet.yaml
@@ -27,6 +27,7 @@ metadata:
     camel.apache.org/kamelet.namespace: "Messaging"
   labels:
     camel.apache.org/kamelet.type: "sink"
+    camel.apache.org/kamelet.verified: "true"
 spec:
   definition:
     title: "NATS Sink"
diff --git a/kamelets/nats-source.kamelet.yaml 
b/kamelets/nats-source.kamelet.yaml
index 12fdf7f49..7a3fd6f79 100644
--- a/kamelets/nats-source.kamelet.yaml
+++ b/kamelets/nats-source.kamelet.yaml
@@ -27,6 +27,7 @@ metadata:
     camel.apache.org/kamelet.namespace: "Messaging"
   labels:
     camel.apache.org/kamelet.type: "source"
+    camel.apache.org/kamelet.verified: "true"
 spec:
   definition:
     title: "NATS Source"
diff --git a/kamelets/redis-sink.kamelet.yaml b/kamelets/redis-sink.kamelet.yaml
index 26e9d4b13..54d9e0456 100644
--- a/kamelets/redis-sink.kamelet.yaml
+++ b/kamelets/redis-sink.kamelet.yaml
@@ -20,6 +20,7 @@ metadata:
   name: redis-sink
   labels:
     camel.apache.org/kamelet.type: "sink"
+    camel.apache.org/kamelet.verified: "true"
   annotations:
     camel.apache.org/kamelet.support.level: "Stable"
     camel.apache.org/catalog.version: "4.24.0-SNAPSHOT"
diff --git a/kamelets/salesforce-create-sink.kamelet.yaml 
b/kamelets/salesforce-create-sink.kamelet.yaml
index f1ec351b4..d45e8b64c 100644
--- a/kamelets/salesforce-create-sink.kamelet.yaml
+++ b/kamelets/salesforce-create-sink.kamelet.yaml
@@ -27,6 +27,7 @@ metadata:
     camel.apache.org/kamelet.namespace: "Salesforce"
   labels:
     camel.apache.org/kamelet.type: "sink"
+    camel.apache.org/kamelet.verified: "true"
 spec:
   definition:
     title: "Salesforce Create Sink"
diff --git a/kamelets/salesforce-delete-sink.kamelet.yaml 
b/kamelets/salesforce-delete-sink.kamelet.yaml
index 108fd6a13..e17b4b266 100644
--- a/kamelets/salesforce-delete-sink.kamelet.yaml
+++ b/kamelets/salesforce-delete-sink.kamelet.yaml
@@ -27,6 +27,7 @@ metadata:
     camel.apache.org/kamelet.namespace: "Salesforce"
   labels:
     camel.apache.org/kamelet.type: "sink"
+    camel.apache.org/kamelet.verified: "true"
 spec:
   definition:
     title: "Salesforce Delete Sink"
diff --git a/kamelets/salesforce-update-sink.kamelet.yaml 
b/kamelets/salesforce-update-sink.kamelet.yaml
index 48bc97d5d..8a9097d05 100644
--- a/kamelets/salesforce-update-sink.kamelet.yaml
+++ b/kamelets/salesforce-update-sink.kamelet.yaml
@@ -27,6 +27,7 @@ metadata:
     camel.apache.org/kamelet.namespace: "Salesforce"
   labels:
     camel.apache.org/kamelet.type: "sink"
+    camel.apache.org/kamelet.verified: "true"
 spec:
   definition:
     title: "Salesforce Update Sink"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/cassandra-sink.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/cassandra-sink.kamelet.yaml
index cf9899044..40418c07d 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/cassandra-sink.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/cassandra-sink.kamelet.yaml
@@ -27,6 +27,7 @@ metadata:
     camel.apache.org/kamelet.namespace: "Nosql"
   labels:
     camel.apache.org/kamelet.type: "sink"
+    camel.apache.org/kamelet.verified: "true"
 spec:
   definition:
     title: "Cassandra Sink"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/mqtt5-sink.kamelet.yaml 
b/library/camel-kamelets/src/main/resources/kamelets/mqtt5-sink.kamelet.yaml
index dc0bb87c5..5c378c2f8 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/mqtt5-sink.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/mqtt5-sink.kamelet.yaml
@@ -27,6 +27,7 @@ metadata:
     camel.apache.org/kamelet.namespace: "Messaging"
   labels:
     camel.apache.org/kamelet.type: "sink"
+    camel.apache.org/kamelet.verified: "true"
 spec:
   definition:
     title: "MQTT v5 Sink"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/mqtt5-source.kamelet.yaml 
b/library/camel-kamelets/src/main/resources/kamelets/mqtt5-source.kamelet.yaml
index 06cf5c333..2c9942b6a 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/mqtt5-source.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/mqtt5-source.kamelet.yaml
@@ -27,6 +27,7 @@ metadata:
     camel.apache.org/kamelet.namespace: "Messaging"
   labels:
     camel.apache.org/kamelet.type: "source"
+    camel.apache.org/kamelet.verified: "true"
 spec:
   definition:
     title: "MQTT 5 Source"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/nats-sink.kamelet.yaml 
b/library/camel-kamelets/src/main/resources/kamelets/nats-sink.kamelet.yaml
index 8a187b6e7..95f2dea68 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/nats-sink.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/nats-sink.kamelet.yaml
@@ -27,6 +27,7 @@ metadata:
     camel.apache.org/kamelet.namespace: "Messaging"
   labels:
     camel.apache.org/kamelet.type: "sink"
+    camel.apache.org/kamelet.verified: "true"
 spec:
   definition:
     title: "NATS Sink"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/nats-source.kamelet.yaml 
b/library/camel-kamelets/src/main/resources/kamelets/nats-source.kamelet.yaml
index 12fdf7f49..7a3fd6f79 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/nats-source.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/nats-source.kamelet.yaml
@@ -27,6 +27,7 @@ metadata:
     camel.apache.org/kamelet.namespace: "Messaging"
   labels:
     camel.apache.org/kamelet.type: "source"
+    camel.apache.org/kamelet.verified: "true"
 spec:
   definition:
     title: "NATS Source"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/redis-sink.kamelet.yaml 
b/library/camel-kamelets/src/main/resources/kamelets/redis-sink.kamelet.yaml
index 26e9d4b13..54d9e0456 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/redis-sink.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/redis-sink.kamelet.yaml
@@ -20,6 +20,7 @@ metadata:
   name: redis-sink
   labels:
     camel.apache.org/kamelet.type: "sink"
+    camel.apache.org/kamelet.verified: "true"
   annotations:
     camel.apache.org/kamelet.support.level: "Stable"
     camel.apache.org/catalog.version: "4.24.0-SNAPSHOT"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/salesforce-create-sink.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/salesforce-create-sink.kamelet.yaml
index f1ec351b4..d45e8b64c 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/salesforce-create-sink.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/salesforce-create-sink.kamelet.yaml
@@ -27,6 +27,7 @@ metadata:
     camel.apache.org/kamelet.namespace: "Salesforce"
   labels:
     camel.apache.org/kamelet.type: "sink"
+    camel.apache.org/kamelet.verified: "true"
 spec:
   definition:
     title: "Salesforce Create Sink"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/salesforce-delete-sink.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/salesforce-delete-sink.kamelet.yaml
index 108fd6a13..e17b4b266 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/salesforce-delete-sink.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/salesforce-delete-sink.kamelet.yaml
@@ -27,6 +27,7 @@ metadata:
     camel.apache.org/kamelet.namespace: "Salesforce"
   labels:
     camel.apache.org/kamelet.type: "sink"
+    camel.apache.org/kamelet.verified: "true"
 spec:
   definition:
     title: "Salesforce Delete Sink"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/salesforce-update-sink.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/salesforce-update-sink.kamelet.yaml
index 48bc97d5d..8a9097d05 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/salesforce-update-sink.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/salesforce-update-sink.kamelet.yaml
@@ -27,6 +27,7 @@ metadata:
     camel.apache.org/kamelet.namespace: "Salesforce"
   labels:
     camel.apache.org/kamelet.type: "sink"
+    camel.apache.org/kamelet.verified: "true"
 spec:
   definition:
     title: "Salesforce Update Sink"
diff --git a/tests/camel-kamelets-itest/src/test/java/AvroIT.java 
b/tests/camel-kamelets-itest/src/test/java/AvroIT.java
index fb82ecadc..d7504ac5c 100644
--- a/tests/camel-kamelets-itest/src/test/java/AvroIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/AvroIT.java
@@ -23,7 +23,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -31,7 +30,7 @@ import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVa
 @CitrusSupport
 public class AvroIT {
 
-    private final int avroWebhookPort = SocketUtils.findAvailableTcpPort();
+    private final int avroWebhookPort = ServerPorts.next();
 
     @BindToRegistry
     public SequenceBeforeTest beforeAvro() {
diff --git a/tests/camel-kamelets-itest/src/test/java/AwsIT.java 
b/tests/camel-kamelets-itest/src/test/java/AwsIT.java
index 209b58816..32a96a058 100644
--- a/tests/camel-kamelets-itest/src/test/java/AwsIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/AwsIT.java
@@ -25,7 +25,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -35,7 +34,7 @@ import static 
org.citrusframework.http.endpoint.builder.HttpEndpoints.http;
 @CitrusSupport
 public class AwsIT {
 
-    private final int awsSinkServerPort = SocketUtils.findAvailableTcpPort();
+    private final int awsSinkServerPort = ServerPorts.next();
 
     @BindToRegistry
     HttpServer awsSinkServer = http()
diff --git a/tests/camel-kamelets-itest/src/test/java/AzureIT.java 
b/tests/camel-kamelets-itest/src/test/java/AzureIT.java
index 800c3f9dc..6a29a3f45 100644
--- a/tests/camel-kamelets-itest/src/test/java/AzureIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/AzureIT.java
@@ -25,7 +25,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -42,7 +41,7 @@ public class AzureIT {
 
     private static final String TESTS = "azure-.*";
 
-    private final int azureServerPort = SocketUtils.findAvailableTcpPort();
+    private final int azureServerPort = ServerPorts.next();
 
     // the emulator container and a first Camel JBang run that downloads the 
client libraries take a while
     @BindToRegistry
diff --git a/tests/camel-kamelets-itest/src/test/java/CassandraIT.java 
b/tests/camel-kamelets-itest/src/test/java/CassandraIT.java
index 9e9c801e5..2acc42517 100644
--- a/tests/camel-kamelets-itest/src/test/java/CassandraIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/CassandraIT.java
@@ -18,14 +18,48 @@
 import java.util.stream.Stream;
 
 import org.citrusframework.api.common.TestLoader;
+import org.citrusframework.container.SequenceAfterTest;
+import org.citrusframework.container.SequenceBeforeTest;
+import org.citrusframework.http.server.HttpServer;
 import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
+import org.citrusframework.spi.BindToRegistry;
 import org.junit.jupiter.api.DynamicTest;
 
+import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
+import static 
org.citrusframework.actions.PurgeEndpointAction.Builder.purgeEndpoints;
+import static org.citrusframework.http.endpoint.builder.HttpEndpoints.http;
+
 @CitrusSupport
 public class CassandraIT {
 
+    private static final String TESTS = "cassandra-.*";
+
+    private final int cassandraServerPort = ServerPorts.next();
+
+    @BindToRegistry
+    HttpServer cassandraServer = http()
+                .server()
+                .port(cassandraServerPort)
+                .timeout(60000L)
+                .autoStart(true)
+                .build();
+
+    @BindToRegistry
+    public SequenceBeforeTest beforeCassandra() {
+        return new SequenceBeforeTest.Builder().onTests(TESTS).actions(
+                createVariables().variable("cassandra.server.port", 
String.valueOf(cassandraServerPort))
+        ).build();
+    }
+
+    @BindToRegistry
+    public SequenceAfterTest afterCassandra() {
+        return new SequenceAfterTest.Builder().onTests(TESTS).actions(
+                purgeEndpoints().endpoint(cassandraServer)
+        ).build();
+    }
+
     @CitrusTestFactory
     public Stream<DynamicTest> cassandra() {
         return 
CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("cassandra");
diff --git a/tests/camel-kamelets-itest/src/test/java/CloudIT.java 
b/tests/camel-kamelets-itest/src/test/java/CloudIT.java
index 3f75f79fc..edc88ab88 100644
--- a/tests/camel-kamelets-itest/src/test/java/CloudIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/CloudIT.java
@@ -25,7 +25,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -41,7 +40,7 @@ public class CloudIT {
 
     private static final String TESTS = "(ceph|github)-.*";
 
-    private final int cloudHttpServerPort = SocketUtils.findAvailableTcpPort();
+    private final int cloudHttpServerPort = ServerPorts.next();
 
     // a container and a first Camel JBang run that downloads the libraries 
take a while
     @BindToRegistry
@@ -53,7 +52,7 @@ public class CloudIT {
                 .build();
 
     // stands in for the GitHub API, with canned answers
-    private final int gitHubApiPort = SocketUtils.findAvailableTcpPort();
+    private final int gitHubApiPort = ServerPorts.next();
 
     @BindToRegistry
     GitHubApiStub gitHubApi = new GitHubApiStub(gitHubApiPort);
diff --git a/tests/camel-kamelets-itest/src/test/java/CommonIT.java 
b/tests/camel-kamelets-itest/src/test/java/CommonIT.java
index 851e0c763..257be333f 100644
--- a/tests/camel-kamelets-itest/src/test/java/CommonIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/CommonIT.java
@@ -25,7 +25,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -35,7 +34,7 @@ import static 
org.citrusframework.http.endpoint.builder.HttpEndpoints.http;
 @CitrusSupport
 public class CommonIT {
 
-    private final int httpServerPort = SocketUtils.findAvailableTcpPort();
+    private final int httpServerPort = ServerPorts.next();
 
     @BindToRegistry
     HttpServer httpServer = http()
diff --git a/tests/camel-kamelets-itest/src/test/java/CouchbaseIT.java 
b/tests/camel-kamelets-itest/src/test/java/CouchbaseIT.java
index a6fd85fa0..37b54605c 100644
--- a/tests/camel-kamelets-itest/src/test/java/CouchbaseIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/CouchbaseIT.java
@@ -25,7 +25,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -37,7 +36,7 @@ public class CouchbaseIT {
 
     private static final String TESTS = "couchbase-.*";
 
-    private final int couchbaseServerPort = SocketUtils.findAvailableTcpPort();
+    private final int couchbaseServerPort = ServerPorts.next();
 
     @BindToRegistry
     HttpServer couchbaseServer = http()
diff --git a/tests/camel-kamelets-itest/src/test/java/DatabaseIT.java 
b/tests/camel-kamelets-itest/src/test/java/DatabaseIT.java
index e9fb4f3e8..0c351ddb6 100644
--- a/tests/camel-kamelets-itest/src/test/java/DatabaseIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/DatabaseIT.java
@@ -25,7 +25,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -39,7 +38,7 @@ import static 
org.citrusframework.http.endpoint.builder.HttpEndpoints.http;
 @CitrusSupport
 public class DatabaseIT {
 
-    private final int httpServerPort = SocketUtils.findAvailableTcpPort();
+    private final int httpServerPort = ServerPorts.next();
 
     @BindToRegistry
     HttpServer httpServer = http()
diff --git a/tests/camel-kamelets-itest/src/test/java/FileIT.java 
b/tests/camel-kamelets-itest/src/test/java/FileIT.java
index 0c9947f66..78c4bf392 100644
--- a/tests/camel-kamelets-itest/src/test/java/FileIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/FileIT.java
@@ -25,7 +25,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -42,11 +41,11 @@ public class FileIT {
 
     private static final String TESTS = 
"(file-watch|ftp|ftps|sftp|scp|ssh)-.*";
 
-    private final int fileHttpServerPort = SocketUtils.findAvailableTcpPort();
+    private final int fileHttpServerPort = ServerPorts.next();
 
     // the FTP server runs in the test, on a free port of this machine; FTP 
opens a second connection for each
     // transfer, which a server in a container cannot offer on a port that is 
mapped to a random one
-    private final int ftpServerPort = SocketUtils.findAvailableTcpPort();
+    private final int ftpServerPort = ServerPorts.next();
 
     // a container and a first Camel JBang run that downloads the libraries 
take a while
     @BindToRegistry
diff --git a/tests/camel-kamelets-itest/src/test/java/GoogleCloudIT.java 
b/tests/camel-kamelets-itest/src/test/java/GoogleCloudIT.java
index b2640f131..b543c942d 100644
--- a/tests/camel-kamelets-itest/src/test/java/GoogleCloudIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/GoogleCloudIT.java
@@ -25,7 +25,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -41,7 +40,7 @@ public class GoogleCloudIT {
 
     private static final String TESTS = "google-.*";
 
-    private final int gcpServerPort = SocketUtils.findAvailableTcpPort();
+    private final int gcpServerPort = ServerPorts.next();
 
     // the emulator container and a first Camel JBang run that downloads the 
client libraries take a while
     @BindToRegistry
diff --git a/tests/camel-kamelets-itest/src/test/java/InfinispanIT.java 
b/tests/camel-kamelets-itest/src/test/java/InfinispanIT.java
index 2554ab7fc..4a71df3f0 100644
--- a/tests/camel-kamelets-itest/src/test/java/InfinispanIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/InfinispanIT.java
@@ -25,7 +25,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -37,7 +36,7 @@ public class InfinispanIT {
 
     private static final String TESTS = "infinispan-.*";
 
-    private final int infinispanServerPort = 
SocketUtils.findAvailableTcpPort();
+    private final int infinispanServerPort = ServerPorts.next();
 
     @BindToRegistry
     HttpServer infinispanServer = http()
diff --git a/tests/camel-kamelets-itest/src/test/java/JiraIT.java 
b/tests/camel-kamelets-itest/src/test/java/JiraIT.java
index b7fee11cc..68334ec7b 100644
--- a/tests/camel-kamelets-itest/src/test/java/JiraIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/JiraIT.java
@@ -25,7 +25,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -35,7 +34,7 @@ import static 
org.citrusframework.http.endpoint.builder.HttpEndpoints.http;
 @CitrusSupport
 public class JiraIT {
 
-    private final int jiraServerPort = SocketUtils.findAvailableTcpPort();
+    private final int jiraServerPort = ServerPorts.next();
 
     @BindToRegistry
     HttpServer jiraServer = http()
diff --git a/tests/camel-kamelets-itest/src/test/java/KafkaIT.java 
b/tests/camel-kamelets-itest/src/test/java/KafkaIT.java
index 306313d9a..ab2bb1282 100644
--- a/tests/camel-kamelets-itest/src/test/java/KafkaIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/KafkaIT.java
@@ -25,7 +25,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -35,7 +34,7 @@ import static 
org.citrusframework.http.endpoint.builder.HttpEndpoints.http;
 @CitrusSupport
 public class KafkaIT {
 
-    private final int kafkaSinkServerPort = SocketUtils.findAvailableTcpPort();
+    private final int kafkaSinkServerPort = ServerPorts.next();
     private final int kafkaWebhookPort = 8080;
 
     @BindToRegistry
diff --git a/tests/camel-kamelets-itest/src/test/java/MailIT.java 
b/tests/camel-kamelets-itest/src/test/java/MailIT.java
index 6d60c1e5f..f410d8cb4 100644
--- a/tests/camel-kamelets-itest/src/test/java/MailIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/MailIT.java
@@ -25,7 +25,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -37,7 +36,7 @@ public class MailIT {
 
     private static final String SOURCE_TESTS = "mail-imap-.*";
 
-    private final int mailHttpServerPort = SocketUtils.findAvailableTcpPort();
+    private final int mailHttpServerPort = ServerPorts.next();
 
     // the source tests send what they receive to this server; a mail server 
container and a first Camel JBang
     // run that downloads the libraries take a while
diff --git a/tests/camel-kamelets-itest/src/test/java/MessagingIT.java 
b/tests/camel-kamelets-itest/src/test/java/MessagingIT.java
index 9d0c53ed1..e8876cf57 100644
--- a/tests/camel-kamelets-itest/src/test/java/MessagingIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/MessagingIT.java
@@ -25,7 +25,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -39,7 +38,7 @@ import static 
org.citrusframework.http.endpoint.builder.HttpEndpoints.http;
 @CitrusSupport
 public class MessagingIT {
 
-    private final int httpServerPort = SocketUtils.findAvailableTcpPort();
+    private final int httpServerPort = ServerPorts.next();
 
     // a broker container and a first Camel JBang run that downloads the 
client libraries take a while,
     // so the server waits longer for the request than in CommonIT
diff --git a/tests/camel-kamelets-itest/src/test/java/MongoIT.java 
b/tests/camel-kamelets-itest/src/test/java/MongoIT.java
index 9b051217f..d5cc15697 100644
--- a/tests/camel-kamelets-itest/src/test/java/MongoIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/MongoIT.java
@@ -25,7 +25,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -37,7 +36,7 @@ public class MongoIT {
 
     private static final String TESTS = "mongodb-.*";
 
-    private final int mongoServerPort = SocketUtils.findAvailableTcpPort();
+    private final int mongoServerPort = ServerPorts.next();
 
     @BindToRegistry
     HttpServer mongoServer = http()
diff --git a/tests/camel-kamelets-itest/src/test/java/Mqtt5IT.java 
b/tests/camel-kamelets-itest/src/test/java/Mqtt5IT.java
index 1d07cb4af..ccdf27fcf 100644
--- a/tests/camel-kamelets-itest/src/test/java/Mqtt5IT.java
+++ b/tests/camel-kamelets-itest/src/test/java/Mqtt5IT.java
@@ -18,14 +18,59 @@
 import java.util.stream.Stream;
 
 import org.citrusframework.api.common.TestLoader;
+import org.citrusframework.container.SequenceAfterTest;
+import org.citrusframework.container.SequenceBeforeTest;
+import org.citrusframework.http.server.HttpServer;
 import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
+import org.citrusframework.spi.BindToRegistry;
 import org.junit.jupiter.api.DynamicTest;
 
+import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
+import static 
org.citrusframework.actions.PurgeEndpointAction.Builder.purgeEndpoints;
+import static org.citrusframework.http.endpoint.builder.HttpEndpoints.http;
+
 @CitrusSupport
 public class Mqtt5IT {
 
+    private static final String TESTS = "mqtt5-.*";
+
+    private final int mqtt5SinkServerPort = ServerPorts.next();
+    private final int mqtt5SourceServerPort = ServerPorts.next();
+
+    @BindToRegistry
+    HttpServer mqtt5SinkServer = http()
+                .server()
+                .port(mqtt5SinkServerPort)
+                .timeout(60000L)
+                .autoStart(true)
+                .build();
+
+    @BindToRegistry
+    HttpServer mqtt5SourceServer = http()
+                .server()
+                .port(mqtt5SourceServerPort)
+                .timeout(60000L)
+                .autoStart(true)
+                .build();
+
+    @BindToRegistry
+    public SequenceBeforeTest beforeMqtt5() {
+        return new SequenceBeforeTest.Builder().onTests(TESTS).actions(
+                createVariables()
+                        .variable("mqtt5.sink.server.port", 
String.valueOf(mqtt5SinkServerPort))
+                        .variable("mqtt5.source.server.port", 
String.valueOf(mqtt5SourceServerPort))
+        ).build();
+    }
+
+    @BindToRegistry
+    public SequenceAfterTest afterMqtt5() {
+        return new SequenceAfterTest.Builder().onTests(TESTS).actions(
+                
purgeEndpoints().endpoint(mqtt5SinkServer).endpoint(mqtt5SourceServer)
+        ).build();
+    }
+
     @CitrusTestFactory
     public Stream<DynamicTest> mqtt5() {
         return 
CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("mqtt5");
diff --git a/tests/camel-kamelets-itest/src/test/java/NatsIT.java 
b/tests/camel-kamelets-itest/src/test/java/NatsIT.java
index 015b63df9..cb35cc440 100644
--- a/tests/camel-kamelets-itest/src/test/java/NatsIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/NatsIT.java
@@ -18,14 +18,48 @@
 import java.util.stream.Stream;
 
 import org.citrusframework.api.common.TestLoader;
+import org.citrusframework.container.SequenceAfterTest;
+import org.citrusframework.container.SequenceBeforeTest;
+import org.citrusframework.http.server.HttpServer;
 import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
+import org.citrusframework.spi.BindToRegistry;
 import org.junit.jupiter.api.DynamicTest;
 
+import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
+import static 
org.citrusframework.actions.PurgeEndpointAction.Builder.purgeEndpoints;
+import static org.citrusframework.http.endpoint.builder.HttpEndpoints.http;
+
 @CitrusSupport
 public class NatsIT {
 
+    private static final String TESTS = "nats-.*";
+
+    private final int natsServerPort = ServerPorts.next();
+
+    @BindToRegistry
+    HttpServer natsServer = http()
+                .server()
+                .port(natsServerPort)
+                .timeout(60000L)
+                .autoStart(true)
+                .build();
+
+    @BindToRegistry
+    public SequenceBeforeTest beforeNats() {
+        return new SequenceBeforeTest.Builder().onTests(TESTS).actions(
+                createVariables().variable("nats.server.port", 
String.valueOf(natsServerPort))
+        ).build();
+    }
+
+    @BindToRegistry
+    public SequenceAfterTest afterNats() {
+        return new SequenceAfterTest.Builder().onTests(TESTS).actions(
+                purgeEndpoints().endpoint(natsServer)
+        ).build();
+    }
+
     @CitrusTestFactory
     public Stream<DynamicTest> nats() {
         return 
CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("nats");
diff --git a/tests/camel-kamelets-itest/src/test/java/OpenApiIT.java 
b/tests/camel-kamelets-itest/src/test/java/OpenApiIT.java
index 18a212b3d..775abc8d0 100644
--- a/tests/camel-kamelets-itest/src/test/java/OpenApiIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/OpenApiIT.java
@@ -25,7 +25,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 import org.springframework.http.HttpStatus;
 
@@ -36,7 +35,7 @@ import static 
org.citrusframework.http.endpoint.builder.HttpEndpoints.http;
 @CitrusSupport
 public class OpenApiIT {
 
-    private final int petstoreServerPort = SocketUtils.findAvailableTcpPort();
+    private final int petstoreServerPort = ServerPorts.next();
 
     @BindToRegistry
     HttpServer petstoreServer = http()
diff --git a/tests/camel-kamelets-itest/src/test/java/PostgresIT.java 
b/tests/camel-kamelets-itest/src/test/java/PostgresIT.java
index 1421ef2c5..a37e0d5bb 100644
--- a/tests/camel-kamelets-itest/src/test/java/PostgresIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/PostgresIT.java
@@ -25,7 +25,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -37,7 +36,7 @@ public class PostgresIT {
 
     private static final String TESTS = "postgresql-.*";
 
-    private final int postgresServerPort = SocketUtils.findAvailableTcpPort();
+    private final int postgresServerPort = ServerPorts.next();
 
     @BindToRegistry
     HttpServer postgresServer = http()
diff --git a/tests/camel-kamelets-itest/src/test/java/ProtobufIT.java 
b/tests/camel-kamelets-itest/src/test/java/ProtobufIT.java
index 84a7af5dd..224f33444 100644
--- a/tests/camel-kamelets-itest/src/test/java/ProtobufIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/ProtobufIT.java
@@ -23,7 +23,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -31,7 +30,7 @@ import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVa
 @CitrusSupport
 public class ProtobufIT {
 
-    private final int protobufWebhookPort = SocketUtils.findAvailableTcpPort();
+    private final int protobufWebhookPort = ServerPorts.next();
 
     @BindToRegistry
     public SequenceBeforeTest beforeProtobuf() {
diff --git a/tests/camel-kamelets-itest/src/test/java/RedisIT.java 
b/tests/camel-kamelets-itest/src/test/java/RedisIT.java
index f4775b50b..641540470 100644
--- a/tests/camel-kamelets-itest/src/test/java/RedisIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/RedisIT.java
@@ -25,7 +25,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -37,7 +36,7 @@ public class RedisIT {
 
     private static final String TESTS = "redis-.*";
 
-    private final int redisServerPort = SocketUtils.findAvailableTcpPort();
+    private final int redisServerPort = ServerPorts.next();
 
     @BindToRegistry
     HttpServer redisServer = http()
diff --git a/tests/camel-kamelets-itest/src/test/java/SearchIT.java 
b/tests/camel-kamelets-itest/src/test/java/SearchIT.java
index 54906a9c0..f25d8ce4a 100644
--- a/tests/camel-kamelets-itest/src/test/java/SearchIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/SearchIT.java
@@ -25,7 +25,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -37,7 +36,7 @@ public class SearchIT {
 
     private static final String TESTS = "(elasticsearch|opensearch|solr)-.*";
 
-    private final int searchServerPort = SocketUtils.findAvailableTcpPort();
+    private final int searchServerPort = ServerPorts.next();
 
     @BindToRegistry
     HttpServer searchServer = http()
diff --git a/tests/camel-kamelets-itest/src/test/java/ServerPorts.java 
b/tests/camel-kamelets-itest/src/test/java/ServerPorts.java
new file mode 100644
index 000000000..15d614075
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/java/ServerPorts.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.citrusframework.util.SocketUtils;
+
+/**
+ * Picks the ports of the HTTP servers that the tests start.
+ * <p>
+ * The port is taken below 32768, outside the ephemeral port range of Linux 
(32768-60999) and macOS (49152-65535).
+ * Docker publishes the ports of the test containers on ephemeral ports, and 
outgoing connections use them too, so a
+ * port picked from that range can be taken between the check that it is free 
and the moment the server binds it (seen
+ * in CI as {@code Failed to bind to 0.0.0.0:50072: Address already in use}). 
A port is also handed out only once per
+ * test run, so that two servers of one test class never get the same port.
+ */
+final class ServerPorts {
+
+    private static final int MIN_PORT = 10000;
+    private static final int MAX_PORT = 32767;
+
+    private static final Set<Integer> USED = ConcurrentHashMap.newKeySet();
+
+    private ServerPorts() {
+    }
+
+    static int next() {
+        while (true) {
+            int port = SocketUtils.findAvailableTcpPort(MIN_PORT, MAX_PORT);
+            if (USED.add(port)) {
+                return port;
+            }
+        }
+    }
+}
diff --git a/tests/camel-kamelets-itest/src/test/java/ServicesIT.java 
b/tests/camel-kamelets-itest/src/test/java/ServicesIT.java
index 20770d5a7..db4558e79 100644
--- a/tests/camel-kamelets-itest/src/test/java/ServicesIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/ServicesIT.java
@@ -25,7 +25,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -42,7 +41,7 @@ public class ServicesIT {
 
     private static final String TESTS = 
"(fhir|telegram|snmp|salesforce|ibm)-.*";
 
-    private final int servicesServerPort = SocketUtils.findAvailableTcpPort();
+    private final int servicesServerPort = ServerPorts.next();
 
     // a container and a first Camel JBang run that downloads the client 
libraries take a while
     @BindToRegistry
diff --git a/tests/camel-kamelets-itest/src/test/java/SlackIT.java 
b/tests/camel-kamelets-itest/src/test/java/SlackIT.java
index 86c0dd601..897bd3c6f 100644
--- a/tests/camel-kamelets-itest/src/test/java/SlackIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/SlackIT.java
@@ -24,7 +24,6 @@ import org.citrusframework.junit.jupiter.CitrusSupport;
 import org.citrusframework.junit.jupiter.CitrusTestFactory;
 import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
 import org.citrusframework.spi.BindToRegistry;
-import org.citrusframework.util.SocketUtils;
 import org.junit.jupiter.api.DynamicTest;
 
 import static 
org.citrusframework.actions.CreateVariablesAction.Builder.createVariables;
@@ -33,8 +32,8 @@ import static 
org.citrusframework.http.endpoint.builder.HttpEndpoints.http;
 @CitrusSupport
 public class SlackIT {
 
-    private final int slackSinkServerPort = SocketUtils.findAvailableTcpPort();
-    private final int slackSourceServerPort = 
SocketUtils.findAvailableTcpPort();
+    private final int slackSinkServerPort = ServerPorts.next();
+    private final int slackSourceServerPort = ServerPorts.next();
 
     @BindToRegistry
     HttpServer slackSinkServer = http()
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/azure/azure-functions-sink-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/azure/azure-functions-sink-route.citrus.it.yaml
index 6f6c067cc..c14fd6c99 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/azure/azure-functions-sink-route.citrus.it.yaml
+++ 
b/tests/camel-kamelets-itest/src/test/resources/azure/azure-functions-sink-route.citrus.it.yaml
@@ -16,7 +16,7 @@
 # ---------------------------------------------------------------------------
 
 name: azure-functions-sink-route-test
-description: 'azure-functions-sink calls the function with the body, the 
Content-Type and the other headers, and the key in x-functions-key'
+description: 'azure-functions-sink calls the function with the body, the 
Content-Type and the other headers, and the key in x-functions-key, but not the 
credentials of the message'
 actions:
   # Create Camel JBang integration. The Citrus HTTP server takes the place of 
the function.
   - camel:
@@ -32,7 +32,8 @@ actions:
                 - name: "azure.server.port"
                   value: "${azure.server.port}"
 
-  # The function gets the body, the Content-Type, the header origin and the 
key, and answers with JSON
+  # The function gets the body, the Content-Type, the header origin and the 
key of the Kamelet (not the one of
+  # the message), and answers with JSON
   - http:
       server: "azureServer"
       receiveRequest:
@@ -47,6 +48,12 @@ actions:
               value: 'citrus'
           body:
             data: '{"orderId":"ORD-1"}'
+
+  # The Authorization and Proxy-Authorization headers of the message are not 
sent to the function. A header
+  # validation cannot check that a header is missing, so a script checks the 
request that was received.
+  - groovy:
+      script:
+        file: "azure/noCredentialHeaders.groovy"
   - http:
       server: "azureServer"
       sendResponse:
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/azure/azure-functions-sink-route.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/azure/azure-functions-sink-route.yaml
index 9eb5508f1..3382e433a 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/azure/azure-functions-sink-route.yaml
+++ 
b/tests/camel-kamelets-itest/src/test/resources/azure/azure-functions-sink-route.yaml
@@ -29,6 +29,16 @@
         - setHeader:
             name: origin
             constant: 'citrus'
+        # credentials that came with the message: the Kamelet must not send 
them on
+        - setHeader:
+            name: Authorization
+            constant: 'Bearer token-of-the-message'
+        - setHeader:
+            name: Proxy-Authorization
+            constant: 'Basic cHJveHk6c2VjcmV0'
+        - setHeader:
+            name: x-functions-key
+            constant: 'key-of-the-message'
         - to:
             uri: "kamelet:azure-functions-sink"
             parameters:
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/azure/noCredentialHeaders.groovy
 
b/tests/camel-kamelets-itest/src/test/resources/azure/noCredentialHeaders.groovy
new file mode 100644
index 000000000..28bc3340a
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/azure/noCredentialHeaders.groovy
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Checks the request that the stand-in for the function received: 
azure-functions-sink must not send on the
+// Authorization and Proxy-Authorization headers of the message. Citrus keeps 
each received message in its message
+// store; the request is the one for the path /api/orders.
+
+def store = context.getMessageStore()
+def requests = store.values().findAll { message ->
+    message.getHeaders().values().any { 
it?.toString()?.endsWith('/api/orders') }
+}
+if (requests.isEmpty()) {
+    throw new IllegalStateException('No received request for /api/orders in 
the message store: ' + store.keySet())
+}
+requests.each { request ->
+    def sent = request.getHeaders().keySet().findAll {
+        it.equalsIgnoreCase('Authorization') || 
it.equalsIgnoreCase('Proxy-Authorization')
+    }
+    if (!sent.isEmpty()) {
+        throw new IllegalStateException('The function got the credential 
headers of the message: ' + sent)
+    }
+}
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/cassandra/cassandra-sink-route.citrus.it.yaml.disabled
 
b/tests/camel-kamelets-itest/src/test/resources/cassandra/cassandra-sink-route.citrus.it.yaml
similarity index 68%
rename from 
tests/camel-kamelets-itest/src/test/resources/cassandra/cassandra-sink-route.citrus.it.yaml.disabled
rename to 
tests/camel-kamelets-itest/src/test/resources/cassandra/cassandra-sink-route.citrus.it.yaml
index ea0a2fef4..10cd95ac1 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/cassandra/cassandra-sink-route.citrus.it.yaml.disabled
+++ 
b/tests/camel-kamelets-itest/src/test/resources/cassandra/cassandra-sink-route.citrus.it.yaml
@@ -16,16 +16,17 @@
 # ---------------------------------------------------------------------------
 
 name: cassandra-sink-route-test
+description: 'cassandra-sink inserts a row from a JSON array of values, and 
the body afterwards is an empty List'
 actions:
   # Create Cassandra infrastructure
   - testcontainers:
       start:
         container:
           name: "cassandra"
-          image: "cassandra:4.1"
+          image: "cassandra:5.0.9"
           exposedPorts:
             - 9042
-          startUpTimeout: 120
+          startUpTimeout: 180
           env:
             - name: "CASSANDRA_SNITCH"
               value: "GossipingPropertyFileSnitch"
@@ -40,7 +41,7 @@ actions:
             - name: "CASSANDRA_DC"
               value: "datacenter1"
           waitFor:
-            logMessage: "Startup complete"
+            logMessage: ".*Startup complete.*"
 
   # Setup keyspace and table
   - groovy:
@@ -49,7 +50,7 @@ actions:
 
   # Create Camel JBang integration (sink)
   - camel:
-      jbang:
+      cli:
         run:
           waitForRunningState: false
           integration:
@@ -59,11 +60,31 @@ actions:
                 - name: "cassandra.host"
                   value: "${CITRUS_TESTCONTAINERS_CASSANDRA_HOST}"
                 - name: "cassandra.port"
-                  value: "${CITRUS_TESTCONTAINERS_CASSANDRA_SERVICE_PORT}"
+                  value: "${CITRUS_TESTCONTAINERS_CASSANDRA_PORT}"
+                - name: "http.sink.url"
+                  value: "http://localhost:${cassandra.server.port}";
 
-  # Verify Cassandra sink executed
-  - camel:
-      jbang:
-        verify:
-          integration: "cassandra-sink-route"
-          logMessage: "from-cassandra-sink"
+  # For an INSERT, the body afterwards is an empty List
+  - http:
+      server: "cassandraServer"
+      receiveRequest:
+        POST:
+          path: "/result"
+          type: "plaintext"
+          headers:
+            - name: "X-Body-Type"
+              value: '@matches(java\.util\..*List)@'
+          body:
+            data: 'size=0'
+  - http:
+      server: "cassandraServer"
+      sendResponse:
+        response:
+          status: 200
+          reasonPhrase: "OK"
+          version: "HTTP/1.1"
+
+  # The row is in the table
+  - groovy:
+      script:
+        file: "cassandra/readBack.groovy"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/cassandra/cassandra-sink-route.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/cassandra/cassandra-sink-route.yaml
index 9350850e5..5ca4c3891 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/cassandra/cassandra-sink-route.yaml
+++ 
b/tests/camel-kamelets-itest/src/test/resources/cassandra/cassandra-sink-route.yaml
@@ -19,11 +19,11 @@
     from:
       uri: "timer:tick"
       parameters:
-        period: "10000"
         repeatCount: 1
       steps:
+      # one value for each ? of the query, in the same order
       - setBody:
-          constant: '[{"id": 42, "name": "sink-test", "value": 
"from-cassandra-sink"}]'
+          constant: '[42, "sink-test", "from-cassandra-sink"]'
       - to:
           uri: "kamelet:cassandra-sink"
           parameters:
@@ -32,3 +32,11 @@
             keyspace: "test_ks"
             query: "INSERT INTO test_data (id, name, value) VALUES (?, ?, ?)"
             consistencyLevel: "ONE"
+      # what the Kamelet gives: the Java type of the body
+      - setHeader:
+          name: X-Body-Type
+          simple: "${body.getClass().getName()}"
+      - setBody:
+          simple: "size=${body.size()}"
+      - to:
+          uri: "{{http.sink.url}}/result"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/cassandra/setupKeyspace.groovy 
b/tests/camel-kamelets-itest/src/test/resources/cassandra/readBack.groovy
similarity index 69%
copy from 
tests/camel-kamelets-itest/src/test/resources/cassandra/setupKeyspace.groovy
copy to tests/camel-kamelets-itest/src/test/resources/cassandra/readBack.groovy
index 6176b3289..c8d265bb6 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/cassandra/setupKeyspace.groovy
+++ b/tests/camel-kamelets-itest/src/test/resources/cassandra/readBack.groovy
@@ -15,15 +15,19 @@
  * limitations under the License.
  */
 
+// Reads the row that cassandra-sink inserted, and fails unless it holds the 
values of the message.
+
 import com.datastax.oss.driver.api.core.CqlSession
 
 def session = CqlSession.builder()
-        .addContactPoint(new 
InetSocketAddress('${CITRUS_TESTCONTAINERS_CASSANDRA_HOST}', 
Integer.parseInt('${CITRUS_TESTCONTAINERS_CASSANDRA_SERVICE_PORT}')))
+        .addContactPoint(new 
InetSocketAddress('${CITRUS_TESTCONTAINERS_CASSANDRA_HOST}', 
Integer.parseInt('${CITRUS_TESTCONTAINERS_CASSANDRA_PORT}')))
         .withLocalDatacenter('datacenter1')
         .build()
-
-session.execute("CREATE KEYSPACE IF NOT EXISTS test_ks WITH replication = 
{'class': 'SimpleStrategy', 'replication_factor': 1}")
-session.execute("CREATE TABLE IF NOT EXISTS test_ks.test_data (id int PRIMARY 
KEY, name text, value text)")
-session.execute("INSERT INTO test_ks.test_data (id, name, value) VALUES (1, 
'test-entry', 'hello-cassandra')")
-
-session.close()
+try {
+    def row = session.execute("SELECT name, value FROM test_ks.test_data WHERE 
id = 42").one()
+    if (row == null || row.getString('name') != 'sink-test' || 
row.getString('value') != 'from-cassandra-sink') {
+        throw new IllegalStateException('Unexpected row with id 42: ' + 
row?.getFormattedContents())
+    }
+} finally {
+    session.close()
+}
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/cassandra/setupKeyspace.groovy 
b/tests/camel-kamelets-itest/src/test/resources/cassandra/setupKeyspace.groovy
index 6176b3289..ede09b5f2 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/cassandra/setupKeyspace.groovy
+++ 
b/tests/camel-kamelets-itest/src/test/resources/cassandra/setupKeyspace.groovy
@@ -18,7 +18,7 @@
 import com.datastax.oss.driver.api.core.CqlSession
 
 def session = CqlSession.builder()
-        .addContactPoint(new 
InetSocketAddress('${CITRUS_TESTCONTAINERS_CASSANDRA_HOST}', 
Integer.parseInt('${CITRUS_TESTCONTAINERS_CASSANDRA_SERVICE_PORT}')))
+        .addContactPoint(new 
InetSocketAddress('${CITRUS_TESTCONTAINERS_CASSANDRA_HOST}', 
Integer.parseInt('${CITRUS_TESTCONTAINERS_CASSANDRA_PORT}')))
         .withLocalDatacenter('datacenter1')
         .build()
 
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/couchbase/application.properties
 
b/tests/camel-kamelets-itest/src/test/resources/couchbase/application.properties
index 3d426efcb..021396156 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/couchbase/application.properties
+++ 
b/tests/camel-kamelets-itest/src/test/resources/couchbase/application.properties
@@ -16,8 +16,6 @@
 # ---------------------------------------------------------------------------
 
 couchbase.protocol=http
-couchbase.hostname=localhost
-couchbase.port=8091
 couchbase.bucket=kamelets
 couchbase.username=Administrator
 couchbase.password=password
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/couchbase/couchbase-sink-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/couchbase/couchbase-sink-route.citrus.it.yaml
index ea11bccce..239632b7c 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/couchbase/couchbase-sink-route.citrus.it.yaml
+++ 
b/tests/camel-kamelets-itest/src/test/resources/couchbase/couchbase-sink-route.citrus.it.yaml
@@ -17,23 +17,18 @@
 
 name: couchbase-sink-route-test
 actions:
-  # Create Couchbase infrastructure.
-  #
-  # Citrus has no built-in Couchbase container type, so this uses the generic
-  # one. The ports are bound one-to-one on purpose: the Couchbase SDK 
bootstraps
-  # from the management port and then reconnects using the addresses the 
cluster
-  # advertises, so a remapped host port makes the client unable to reach the
-  # data service.
+  # Create Couchbase infrastructure, on random host ports: initCluster.groovy
+  # advertises them to the Couchbase SDK as the external addresses of the node
   - testcontainers:
       start:
         container:
           name: "couchbase"
           image: "couchbase/server:community-7.6.2"
           startUpTimeout: 300
-          portBindings:
-            - "8091:8091"
-            - "8093:8093"
-            - "11210:11210"
+          exposedPorts:
+            - 8091
+            - 8093
+            - 11210
           waitFor:
             logMessage: ".*Starting Couchbase Server.*"
 
@@ -51,6 +46,10 @@ actions:
             systemProperties:
               file: "couchbase/application.properties"
               properties:
+                - name: "couchbase.hostname"
+                  value: "${couchbase.host}"
+                - name: "couchbase.connection.string"
+                  value: "couchbase://${couchbase.host}:${couchbase.kv.port}"
                 - name: "http.sink.url"
                   value: "http://localhost:${couchbase.server.port}";
 
@@ -78,7 +77,7 @@ actions:
 
   # the document is stored as a JSON document, under the id of the 
CamelCouchbaseId header
   - http:
-      client: "http://localhost:8093";
+      client: "http://${couchbase.host}:${couchbase.query.port}";
       sendRequest:
         POST:
           path: "/query/service"
@@ -89,7 +88,7 @@ actions:
           body:
             data: '{"statement":"SELECT RAW k FROM `kamelets` k USE KEYS 
''order-1''"}'
   - http:
-      client: "http://localhost:8093";
+      client: "http://${couchbase.host}:${couchbase.query.port}";
       receiveResponse:
         response:
           status: 200
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/couchbase/couchbase-sink-route.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/couchbase/couchbase-sink-route.yaml
index d9b8c4c63..5a032e44d 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/couchbase/couchbase-sink-route.yaml
+++ 
b/tests/camel-kamelets-itest/src/test/resources/couchbase/couchbase-sink-route.yaml
@@ -32,6 +32,7 @@
             parameters:
               protocol: "{{couchbase.protocol}}"
               couchbaseHostname: "{{couchbase.hostname}}"
+              connectionString: "{{couchbase.connection.string}}"
               bucket: "{{couchbase.bucket}}"
               username: "{{couchbase.username}}"
               password: "{{couchbase.password}}"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/couchbase/couchbase-source-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/couchbase/couchbase-source-route.citrus.it.yaml
index ccf378dc7..f0ca2c2c7 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/couchbase/couchbase-source-route.citrus.it.yaml
+++ 
b/tests/camel-kamelets-itest/src/test/resources/couchbase/couchbase-source-route.citrus.it.yaml
@@ -17,23 +17,18 @@
 
 name: couchbase-source-route-test
 actions:
-  # Create Couchbase infrastructure.
-  #
-  # Citrus has no built-in Couchbase container type, so this uses the generic
-  # one. The ports are bound one-to-one on purpose: the Couchbase SDK 
bootstraps
-  # from the management port and then reconnects using the addresses the 
cluster
-  # advertises, so a remapped host port makes the client unable to reach the
-  # data service.
+  # Create Couchbase infrastructure, on random host ports: initCluster.groovy
+  # advertises them to the Couchbase SDK as the external addresses of the node
   - testcontainers:
       start:
         container:
           name: "couchbase"
           image: "couchbase/server:community-7.6.2"
           startUpTimeout: 300
-          portBindings:
-            - "8091:8091"
-            - "8093:8093"
-            - "11210:11210"
+          exposedPorts:
+            - 8091
+            - 8093
+            - 11210
           waitFor:
             logMessage: ".*Starting Couchbase Server.*"
 
@@ -51,10 +46,33 @@ actions:
             file: "couchbase/couchbase-source-route.yaml"
             systemProperties:
               file: "couchbase/application.properties"
+              properties:
+                - name: "couchbase.hostname"
+                  value: "${couchbase.host}"
+                - name: "couchbase.connection.string"
+                  value: "couchbase://${couchbase.host}:${couchbase.kv.port}"
+                - name: "http.sink.url"
+                  value: "http://localhost:${couchbase.server.port}";
 
-  # Verify the Couchbase source picked up the seeded document
-  - camel:
-      cli:
-        verify:
-          integration: "couchbase-source-route"
-          logMessage: "hello-from-couchbase"
+  # The source gives each row of the query as JSON text, with the document ID
+  - http:
+      server: "couchbaseServer"
+      receiveRequest:
+        POST:
+          path: "/result"
+          headers:
+            - name: "X-Body-Type"
+              value: 'java.lang.String'
+            - name: "X-Content-Type"
+              value: 'ct='
+            - name: "X-Id"
+              value: 'doc1'
+          body:
+            data: 
'{"_default":{"message":"hello-from-couchbase"},"__id":"doc1"}'
+  - http:
+      server: "couchbaseServer"
+      sendResponse:
+        response:
+          status: 200
+          reasonPhrase: "OK"
+          version: "HTTP/1.1"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/couchbase/couchbase-source-route.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/couchbase/couchbase-source-route.yaml
index 129232091..b8d71acbd 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/couchbase/couchbase-source-route.yaml
+++ 
b/tests/camel-kamelets-itest/src/test/resources/couchbase/couchbase-source-route.yaml
@@ -21,12 +21,23 @@
       parameters:
         protocol: "{{couchbase.protocol}}"
         couchbaseHostname: "{{couchbase.hostname}}"
-        couchbasePort: "{{couchbase.port}}"
+        connectionString: "{{couchbase.connection.string}}"
         bucket: "{{couchbase.bucket}}"
         username: "{{couchbase.username}}"
         password: "{{couchbase.password}}"
         statement: "{{couchbase.statement}}"
         delay: 2000
       steps:
+      # what the Kamelet gives: the Java type of the body and the Content-Type
+      - setHeader:
+          name: X-Body-Type
+          simple: "${body.getClass().getName()}"
+      - setHeader:
+          name: X-Content-Type
+          simple: "ct=${header.Content-Type}"
+      # the HTTP component does not send the headers that start with Camel
+      - setHeader:
+          name: X-Id
+          simple: "${header[CamelCouchbaseId]}"
       - to:
-          uri: "kamelet:log-sink"
+          uri: "{{http.sink.url}}/result"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/couchbase/initCluster.groovy 
b/tests/camel-kamelets-itest/src/test/resources/couchbase/initCluster.groovy
index 2ec58c195..afd8551a4 100644
--- a/tests/camel-kamelets-itest/src/test/resources/couchbase/initCluster.groovy
+++ b/tests/camel-kamelets-itest/src/test/resources/couchbase/initCluster.groovy
@@ -16,8 +16,16 @@
  */
 
 // Brings a freshly started Couchbase container to the point where the
-// couchbase-source Kamelet can poll it: initialise the cluster, create a
-// bucket, add a primary index and seed one document.
+// couchbase Kamelets can use it: initialise the cluster, create a bucket, add 
a
+// primary index and seed one document.
+//
+// The container publishes its ports on random host ports, so that the test 
does
+// not fail when another process uses 8091, 8093 or 11210. The Couchbase SDK
+// reconnects to the addresses the cluster advertises, so the script renames 
the
+// node to the IP address of the container and advertises the published host 
and ports as
+// the "external" alternate addresses. A client whose seed host is that host 
then
+// uses them. The script sets these test variables for the test and the routes:
+// couchbase.host, couchbase.mgmt.port, couchbase.query.port and 
couchbase.kv.port.
 //
 // Two deliberate constraints:
 //  - plain HTTP rather than the Couchbase SDK, so the test module does not 
need
@@ -25,16 +33,26 @@
 //  - string concatenation rather than Groovy GStrings, because Citrus resolves
 //    dollar-brace expressions in these scripts as its own test variables
 
-def admin = 'http://localhost:8091'
-def query = 'http://localhost:8093/query/service'
+def container = context.getReferenceResolver().resolve('couchbase')
+def host = container.getHost()
+def mgmtPort = container.getMappedPort(8091)
+def queryPort = container.getMappedPort(8093)
+def kvPort = container.getMappedPort(11210)
+context.setVariable('couchbase.host', host)
+context.setVariable('couchbase.mgmt.port', String.valueOf(mgmtPort))
+context.setVariable('couchbase.query.port', String.valueOf(queryPort))
+context.setVariable('couchbase.kv.port', String.valueOf(kvPort))
+
+def admin = 'http://' + host + ':' + mgmtPort
+def query = 'http://' + host + ':' + queryPort + '/query/service'
 def user = 'Administrator'
 def pass = 'password'
 def bucket = 'kamelets'
 def basic = 'Basic ' + (user + ':' + pass).bytes.encodeBase64().toString()
 
-def call = { String url, String body, boolean auth ->
+def call = { String url, String body, boolean auth, String method = 'POST' ->
     def conn = new URL(url).openConnection()
-    conn.requestMethod = 'POST'
+    conn.requestMethod = method
     conn.doOutput = true
     conn.connectTimeout = 10000
     conn.readTimeout = 60000
@@ -45,7 +63,8 @@ def call = { String url, String body, boolean auth ->
     conn.outputStream.withWriter { it << body }
     def code = conn.responseCode
     if (code >= 400) {
-        throw new IllegalStateException('POST ' + url + ' failed with ' + code)
+        def error = conn.errorStream?.text
+        throw new IllegalStateException(method + ' ' + url + ' failed with ' + 
code + ': ' + error)
     }
     return code
 }
@@ -71,10 +90,17 @@ if (!ready) {
     throw new IllegalStateException('Couchbase management port did not become 
available at ' + admin)
 }
 
+// the node name the cluster advertises on its default network, which must not 
be the seed host of the
+// client: the IP address of the container (Couchbase does not accept a short 
host name)
+def nodeName = 
container.getContainerInfo().getNetworkSettings().getNetworks().values()
+        .collect { it.getIpAddress() }.find { it } ?: '127.0.0.1'
+call(admin + '/node/controller/rename', 'hostname=' + nodeName, false)
 call(admin + '/pools/default', 'memoryQuota=512&indexMemoryQuota=512', false)
 call(admin + '/node/controller/setupServices', 'services=kv%2Cn1ql%2Cindex', 
false)
 call(admin + '/settings/web', 'port=SAME&username=' + user + '&password=' + 
pass, false)
 call(admin + '/settings/indexes', 'storageMode=forestdb', true)
+call(admin + '/node/controller/setupAlternateAddresses/external',
+        'hostname=' + host + '&mgmt=' + mgmtPort + '&kv=' + kvPort + '&n1ql=' 
+ queryPort, true, 'PUT')
 call(admin + '/pools/default/buckets', 'name=' + bucket + 
'&ramQuota=128&bucketType=couchbase', true)
 
 // The bucket is created asynchronously and the query service only sees the
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/mqtt5/mqtt5-sink-route.yaml 
b/tests/camel-kamelets-itest/src/test/resources/mqtt5/mqtt5-sink-route.yaml
index 4b99efbb7..c00a3345c 100644
--- a/tests/camel-kamelets-itest/src/test/resources/mqtt5/mqtt5-sink-route.yaml
+++ b/tests/camel-kamelets-itest/src/test/resources/mqtt5/mqtt5-sink-route.yaml
@@ -19,14 +19,28 @@
     from:
       uri: "timer:tick"
       parameters:
-        period: "10000"
         repeatCount: 1
       steps:
       - setBody:
-          constant: "{{test.message}}"
-      - log: "${body}"
+          constant: "hello-mqtt5"
+      # retained, so that the source gets the message also when it subscribes 
after it is published
       - to:
           uri: "kamelet:mqtt5-sink"
           parameters:
             topic: "{{mqtt.topic}}"
             brokerUrl: "{{mqtt.brokerUrl}}"
+            retained: true
+      # what the Kamelet leaves: the Java type of the body and the Content-Type
+      - setHeader:
+          name: X-Body-Type
+          simple: "${body.getClass().getName()}"
+      - setHeader:
+          name: X-Content-Type
+          simple: "ct=${header.Content-Type}"
+      # Citrus reads a byte[] body as its Java text form 
(citrusframework/citrus#2081)
+      - removeHeader:
+          name: Content-Type
+      - convertBodyTo:
+          type: "java.lang.String"
+      - to:
+          uri: "{{http.sink.url}}/sink"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/mqtt5/mqtt5-sink-to-source-route.citrus.it.yaml.disabled
 
b/tests/camel-kamelets-itest/src/test/resources/mqtt5/mqtt5-sink-to-source-route.citrus.it.yaml
similarity index 51%
rename from 
tests/camel-kamelets-itest/src/test/resources/mqtt5/mqtt5-sink-to-source-route.citrus.it.yaml.disabled
rename to 
tests/camel-kamelets-itest/src/test/resources/mqtt5/mqtt5-sink-to-source-route.citrus.it.yaml
index 6f55c29ed..206eb16e9 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/mqtt5/mqtt5-sink-to-source-route.citrus.it.yaml.disabled
+++ 
b/tests/camel-kamelets-itest/src/test/resources/mqtt5/mqtt5-sink-to-source-route.citrus.it.yaml
@@ -16,62 +16,97 @@
 # ---------------------------------------------------------------------------
 
 name: mqtt5-sink-to-source-route-test
+description: 'mqtt5-sink publishes a retained text message to EMQX, and 
mqtt5-source receives it as bytes'
 variables:
-  - name: "test.message"
-    value: "hello-mqtt5-test"
   - name: "mqtt.topic"
     value: "test/topic"
 actions:
-  # Start EMQX MQTT broker (allows anonymous by default)
+  # EMQX allows anonymous clients by default
   - testcontainers:
       start:
         container:
           name: "mqtt"
-          image: "emqx/emqx:5"
+          image: "emqx/emqx:5.8.9"
+          startUpTimeout: 180
           exposedPorts:
             - 1883
-          env:
-            - name: "EMQX_LISTENERS__TCP__DEFAULT__ENABLE"
-              value: "true"
           waitFor:
-            disabled: true
+            logMessage: '.*is running now.*'
 
-  # Wait for EMQX to be ready
-  - sleep:
-      milliseconds: 10000
-
-  # Start source (subscriber) first
   - camel:
-      jbang:
+      cli:
         run:
+          waitForRunningState: false
           integration:
-            file: "mqtt5/mqtt5-source-route.yaml"
+            file: "mqtt5/mqtt5-sink-route.yaml"
             systemProperties:
               properties:
                 - name: "mqtt.topic"
                   value: "${mqtt.topic}"
                 - name: "mqtt.brokerUrl"
                   value: 
"tcp://${CITRUS_TESTCONTAINERS_MQTT_HOST}:${CITRUS_TESTCONTAINERS_MQTT_PORT}"
+                - name: "http.sink.url"
+                  value: "http://localhost:${mqtt5.sink.server.port}";
 
-  # Start sink (publisher)
   - camel:
-      jbang:
+      cli:
         run:
           waitForRunningState: false
           integration:
-            file: "mqtt5/mqtt5-sink-route.yaml"
+            file: "mqtt5/mqtt5-source-route.yaml"
             systemProperties:
               properties:
-                - name: "test.message"
-                  value: "${test.message}"
                 - name: "mqtt.topic"
                   value: "${mqtt.topic}"
                 - name: "mqtt.brokerUrl"
                   value: 
"tcp://${CITRUS_TESTCONTAINERS_MQTT_HOST}:${CITRUS_TESTCONTAINERS_MQTT_PORT}"
+                - name: "http.source.url"
+                  value: "http://localhost:${mqtt5.source.server.port}";
 
-  # Verify source received the message
-  - camel:
-      jbang:
-        verify:
-          integration: "mqtt5-source-route"
-          logMessage: "${test.message}"
+  # After the sink, the body is the payload as bytes, as 
application/octet-stream
+  - http:
+      server: "mqtt5SinkServer"
+      receiveRequest:
+        POST:
+          path: "/sink"
+          type: "plaintext"
+          headers:
+            - name: "X-Body-Type"
+              value: '[B'
+            - name: "X-Content-Type"
+              value: 'ct=application/octet-stream'
+          body:
+            data: 'hello-mqtt5'
+  - http:
+      server: "mqtt5SinkServer"
+      sendResponse:
+        response:
+          status: 200
+          reasonPhrase: "OK"
+          version: "HTTP/1.1"
+
+  # The source gives the payload as bytes, with the topic and the quality of 
service 2
+  - http:
+      server: "mqtt5SourceServer"
+      receiveRequest:
+        POST:
+          path: "/result"
+          type: "plaintext"
+          headers:
+            - name: "X-Body-Type"
+              value: '[B'
+            - name: "X-Content-Type"
+              value: 'ct=application/octet-stream'
+            - name: "X-Topic"
+              value: 'test/topic'
+            - name: "X-QoS"
+              value: '2'
+          body:
+            data: 'hello-mqtt5'
+  - http:
+      server: "mqtt5SourceServer"
+      sendResponse:
+        response:
+          status: 200
+          reasonPhrase: "OK"
+          version: "HTTP/1.1"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/mqtt5/mqtt5-source-route.yaml 
b/tests/camel-kamelets-itest/src/test/resources/mqtt5/mqtt5-source-route.yaml
index 6519ba526..80c67134b 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/mqtt5/mqtt5-source-route.yaml
+++ 
b/tests/camel-kamelets-itest/src/test/resources/mqtt5/mqtt5-source-route.yaml
@@ -23,5 +23,24 @@
         brokerUrl: "{{mqtt.brokerUrl}}"
         clientId: "mqtt5-source-test"
       steps:
+      # what the Kamelet gives: the Java type of the body and the Content-Type
+      - setHeader:
+          name: X-Body-Type
+          simple: "${body.getClass().getName()}"
+      - setHeader:
+          name: X-Content-Type
+          simple: "ct=${header.Content-Type}"
+      # the HTTP component does not send the headers that start with Camel
+      - setHeader:
+          name: X-Topic
+          simple: "${header[CamelMqttTopic]}"
+      - setHeader:
+          name: X-QoS
+          simple: "${header[CamelMqttQoS]}"
+      # Citrus reads a byte[] body as its Java text form 
(citrusframework/citrus#2081)
+      - removeHeader:
+          name: Content-Type
+      - convertBodyTo:
+          type: "java.lang.String"
       - to:
-          uri: "kamelet:log-sink"
+          uri: "{{http.source.url}}/result"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/nats/nats-sink-route.yaml 
b/tests/camel-kamelets-itest/src/test/resources/nats/nats-sink-route.yaml
index 04d4fa2eb..7be950ec5 100644
--- a/tests/camel-kamelets-itest/src/test/resources/nats/nats-sink-route.yaml
+++ b/tests/camel-kamelets-itest/src/test/resources/nats/nats-sink-route.yaml
@@ -15,16 +15,21 @@
 # limitations under the License.
 # ---------------------------------------------------------------------------
 
+# A plain NATS subject keeps nothing for a receiver that subscribes later, so 
the
+# message is published every second until the test has received one through the
+# source; the test then stops the integrations.
 - route:
     from:
       uri: "timer:tick"
       parameters:
-        period: "10000"
-        repeatCount: 1
+        period: "1000"
       steps:
       - setBody:
-          constant: "{{test.message}}"
-      - log: "${body}"
+          constant: "hello-nats"
+      # sent as a NATS header
+      - setHeader:
+          name: origin
+          constant: "citrus"
       - to:
           uri: "kamelet:nats-sink"
           parameters:
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/nats/nats-sink-to-source-route.citrus.it.yaml.disabled
 
b/tests/camel-kamelets-itest/src/test/resources/nats/nats-sink-to-source-route.citrus.it.yaml
similarity index 64%
rename from 
tests/camel-kamelets-itest/src/test/resources/nats/nats-sink-to-source-route.citrus.it.yaml.disabled
rename to 
tests/camel-kamelets-itest/src/test/resources/nats/nats-sink-to-source-route.citrus.it.yaml
index 5a42605e0..51201659c 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/nats/nats-sink-to-source-route.citrus.it.yaml.disabled
+++ 
b/tests/camel-kamelets-itest/src/test/resources/nats/nats-sink-to-source-route.citrus.it.yaml
@@ -16,31 +16,25 @@
 # ---------------------------------------------------------------------------
 
 name: nats-sink-to-source-route-test
+description: 'nats-sink publishes a text message with a header to a NATS 
subject, and nats-source receives it as bytes, with the header'
 variables:
-  - name: "test.message"
-    value: "hello-nats-test"
   - name: "nats.topic"
     value: "test-topic"
 actions:
-  # Start NATS container
   - testcontainers:
       start:
         container:
           name: "nats"
-          image: "nats:2"
+          image: "nats:2.15.3-alpine"
           exposedPorts:
             - 4222
           waitFor:
-            disabled: true
+            logMessage: '.*Server is ready.*'
 
-  # Wait for NATS to be ready
-  - sleep:
-      milliseconds: 5000
-
-  # Start source (subscriber) first
   - camel:
-      jbang:
+      cli:
         run:
+          waitForRunningState: false
           integration:
             file: "nats/nats-source-route.yaml"
             systemProperties:
@@ -49,26 +43,44 @@ actions:
                   value: "${nats.topic}"
                 - name: "nats.servers"
                   value: 
"nats://${CITRUS_TESTCONTAINERS_NATS_HOST}:${CITRUS_TESTCONTAINERS_NATS_PORT}"
+                - name: "http.sink.url"
+                  value: "http://localhost:${nats.server.port}";
 
-  # Start sink (publisher)
   - camel:
-      jbang:
+      cli:
         run:
           waitForRunningState: false
           integration:
             file: "nats/nats-sink-route.yaml"
             systemProperties:
               properties:
-                - name: "test.message"
-                  value: "${test.message}"
                 - name: "nats.topic"
                   value: "${nats.topic}"
                 - name: "nats.servers"
                   value: 
"nats://${CITRUS_TESTCONTAINERS_NATS_HOST}:${CITRUS_TESTCONTAINERS_NATS_PORT}"
 
-  # Verify source received the message
-  - camel:
-      jbang:
-        verify:
-          integration: "nats-source-route"
-          logMessage: "${test.message}"
+  # The source gives the payload as bytes, with the subject and the NATS 
header of the sink
+  - http:
+      server: "natsServer"
+      receiveRequest:
+        POST:
+          path: "/result"
+          type: "plaintext"
+          headers:
+            - name: "X-Body-Type"
+              value: '[B'
+            - name: "X-Content-Type"
+              value: 'ct='
+            - name: "X-Subject"
+              value: 'test-topic'
+            - name: "X-Origin"
+              value: 'citrus'
+          body:
+            data: 'hello-nats'
+  - http:
+      server: "natsServer"
+      sendResponse:
+        response:
+          status: 200
+          reasonPhrase: "OK"
+          version: "HTTP/1.1"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/nats/nats-source-route.yaml 
b/tests/camel-kamelets-itest/src/test/resources/nats/nats-source-route.yaml
index 531c6269c..362c67adc 100644
--- a/tests/camel-kamelets-itest/src/test/resources/nats/nats-source-route.yaml
+++ b/tests/camel-kamelets-itest/src/test/resources/nats/nats-source-route.yaml
@@ -22,5 +22,24 @@
         topic: "{{nats.topic}}"
         servers: "{{nats.servers}}"
       steps:
+      # what the Kamelet gives: the Java type of the body and the Content-Type
+      - setHeader:
+          name: X-Body-Type
+          simple: "${body.getClass().getName()}"
+      - setHeader:
+          name: X-Content-Type
+          simple: "ct=${header.Content-Type}"
+      # the HTTP component does not send the headers that start with Camel
+      - setHeader:
+          name: X-Subject
+          simple: "${header[CamelNatsSubject]}"
+      - setHeader:
+          name: X-Origin
+          simple: "${header[origin]}"
+      - removeHeader:
+          name: origin
+      # Citrus reads a byte[] body as its Java text form 
(citrusframework/citrus#2081)
+      - convertBodyTo:
+          type: "java.lang.String"
       - to:
-          uri: "kamelet:log-sink"
+          uri: "{{http.sink.url}}/result"
diff --git a/tests/camel-kamelets-itest/src/test/resources/redis/get.groovy 
b/tests/camel-kamelets-itest/src/test/resources/redis/get.groovy
new file mode 100644
index 000000000..7477623af
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/resources/redis/get.groovy
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Reads the key "test-key" with GET, in the Redis protocol over a plain 
socket,
+// so the test module needs no Redis client. It fails unless the value is the
+// text that redis-sink stored.
+
+def args = ['GET', 'test-key']
+def command = new StringBuilder('*' + args.size() + '\r\n')
+args.each { 
command.append('$').append(it.getBytes('UTF-8').length).append('\r\n').append(it).append('\r\n')
 }
+
+def socket = new Socket('${CITRUS_TESTCONTAINERS_REDIS_HOST}', 
'${CITRUS_TESTCONTAINERS_REDIS_PORT}' as int)
+try {
+    socket.soTimeout = 10000
+    socket.outputStream.write(command.toString().getBytes('UTF-8'))
+    socket.outputStream.flush()
+    def reader = new BufferedReader(new InputStreamReader(socket.inputStream, 
'UTF-8'))
+    def length = reader.readLine()
+    def value = reader.readLine()
+    if (length != '$11' || value != 'hello-redis') {
+        throw new IllegalStateException('Unexpected value of test-key: ' + 
length + ' ' + value)
+    }
+} finally {
+    socket.close()
+}
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/redis/redis-sink-route.citrus.it.yaml.disabled
 
b/tests/camel-kamelets-itest/src/test/resources/redis/redis-sink-route.citrus.it.yaml
similarity index 61%
rename from 
tests/camel-kamelets-itest/src/test/resources/redis/redis-sink-route.citrus.it.yaml.disabled
rename to 
tests/camel-kamelets-itest/src/test/resources/redis/redis-sink-route.citrus.it.yaml
index c38c59668..b4d5629c1 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/redis/redis-sink-route.citrus.it.yaml.disabled
+++ 
b/tests/camel-kamelets-itest/src/test/resources/redis/redis-sink-route.citrus.it.yaml
@@ -17,20 +17,16 @@
 
 name: redis-sink-route-test
 actions:
-  # Create Redis infrastructure
   - testcontainers:
       start:
         container:
           name: "redis"
-          image: "redis:7"
+          image: "redis:7.4.12-alpine"
           exposedPorts:
             - 6379
-          waitFor:
-            logMessage: "Ready to accept connections"
 
-  # Create Camel JBang integration (sink)
   - camel:
-      jbang:
+      cli:
         run:
           waitForRunningState: false
           integration:
@@ -40,11 +36,33 @@ actions:
                 - name: "redis.host"
                   value: "${CITRUS_TESTCONTAINERS_REDIS_HOST}"
                 - name: "redis.port"
-                  value: "${CITRUS_TESTCONTAINERS_REDIS_SERVICE_PORT}"
+                  value: "${CITRUS_TESTCONTAINERS_REDIS_PORT}"
+                - name: "http.sink.url"
+                  value: "http://localhost:${redis.server.port}";
 
-  # Verify Redis sink executed
-  - camel:
-      jbang:
-        verify:
-          integration: "redis-sink-route"
-          logMessage: "hello-redis"
+  # SET left the body as it was, and GET with the Kamelet gives the stored 
value
+  - http:
+      server: "redisServer"
+      receiveRequest:
+        POST:
+          path: "/result"
+          type: "plaintext"
+          headers:
+            - name: "X-After-Set"
+              value: 'hello-redis'
+            - name: "X-Body-Type"
+              value: 'java.lang.String'
+          body:
+            data: 'hello-redis'
+  - http:
+      server: "redisServer"
+      sendResponse:
+        response:
+          status: 200
+          reasonPhrase: "OK"
+          version: "HTTP/1.1"
+
+  # the value is in Redis, as text
+  - groovy:
+      script:
+        file: "redis/get.groovy"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/redis/redis-sink-route.yaml 
b/tests/camel-kamelets-itest/src/test/resources/redis/redis-sink-route.yaml
index 51b43010d..822f90669 100644
--- a/tests/camel-kamelets-itest/src/test/resources/redis/redis-sink-route.yaml
+++ b/tests/camel-kamelets-itest/src/test/resources/redis/redis-sink-route.yaml
@@ -19,7 +19,6 @@
     from:
       uri: "timer:tick"
       parameters:
-        period: "10000"
         repeatCount: 1
       steps:
       - setBody:
@@ -33,3 +32,21 @@
             redisHost: "{{redis.host}}"
             redisPort: "{{redis.port}}"
             command: "SET"
+      # for SET the body stays as it was
+      - setHeader:
+          name: X-After-Set
+          simple: "${body}"
+      # read the value back with the Kamelet: for GET the body is the value
+      - setBody:
+          constant: ""
+      - to:
+          uri: "kamelet:redis-sink"
+          parameters:
+            redisHost: "{{redis.host}}"
+            redisPort: "{{redis.port}}"
+            command: "GET"
+      - setHeader:
+          name: X-Body-Type
+          simple: "${body.getClass().getName()}"
+      - to:
+          uri: "{{http.sink.url}}/result"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-composite-upsert-sink-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-composite-upsert-sink-route.citrus.it.yaml
index 64e589ba1..750a4017b 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-composite-upsert-sink-route.citrus.it.yaml
+++ 
b/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-composite-upsert-sink-route.citrus.it.yaml
@@ -38,10 +38,6 @@ actions:
       cli:
         run:
           waitForRunningState: false
-          # camel-salesforce gets protobuf-java 3.x through grpc-protobuf, but 
its Pub/Sub classes need 4.x,
-          # without which the component does not start in Camel JBang
-          args:
-            - "--dep=com.google.protobuf:protobuf-java:4.35.1"
           integration:
             file: "salesforce/salesforce-composite-upsert-sink-route.yaml"
             systemProperties:
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-create-sink-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-create-sink-route.citrus.it.yaml
index 54e846dbc..5df7335ed 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-create-sink-route.citrus.it.yaml
+++ 
b/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-create-sink-route.citrus.it.yaml
@@ -38,10 +38,6 @@ actions:
       cli:
         run:
           waitForRunningState: false
-          # camel-salesforce gets protobuf-java 3.x through grpc-protobuf, but 
its Pub/Sub classes need 4.x,
-          # without which the component does not start in Camel JBang
-          args:
-            - "--dep=com.google.protobuf:protobuf-java:4.35.1"
           integration:
             file: "salesforce/salesforce-create-sink-route.yaml"
             systemProperties:
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-delete-sink-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-delete-sink-route.citrus.it.yaml
index 0ba2755f6..23ac91489 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-delete-sink-route.citrus.it.yaml
+++ 
b/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-delete-sink-route.citrus.it.yaml
@@ -38,10 +38,6 @@ actions:
       cli:
         run:
           waitForRunningState: false
-          # camel-salesforce gets protobuf-java 3.x through grpc-protobuf, but 
its Pub/Sub classes need 4.x,
-          # without which the component does not start in Camel JBang
-          args:
-            - "--dep=com.google.protobuf:protobuf-java:4.35.1"
           integration:
             file: "salesforce/salesforce-delete-sink-route.yaml"
             systemProperties:
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-update-sink-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-update-sink-route.citrus.it.yaml
index d24a5a500..5ff8d0344 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-update-sink-route.citrus.it.yaml
+++ 
b/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-update-sink-route.citrus.it.yaml
@@ -38,10 +38,6 @@ actions:
       cli:
         run:
           waitForRunningState: false
-          # camel-salesforce gets protobuf-java 3.x through grpc-protobuf, but 
its Pub/Sub classes need 4.x,
-          # without which the component does not start in Camel JBang
-          args:
-            - "--dep=com.google.protobuf:protobuf-java:4.35.1"
           integration:
             file: "salesforce/salesforce-update-sink-route.yaml"
             systemProperties:

Reply via email to