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

oscerd 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 82caead04 chore: Add Citrus integration tests for database kamelets 
(#2919)
82caead04 is described below

commit 82caead04ff967d32ff7773306460ad0fb86b84f
Author: Andrea Cosentino <[email protected]>
AuthorDate: Mon Jul 13 10:35:03 2026 +0200

    chore: Add Citrus integration tests for database kamelets (#2919)
    
    * chore: Add Citrus integration tests for database kamelets
    
    Add container-based Citrus integration tests for 7 database kamelets
    using Testcontainers:
    
    - postgresql-source/sink (native Citrus postgresql: DSL with initScript)
    - mongodb-source/sink (native Citrus mongodb: DSL)
    - redis-sink (generic container: DSL with redis:7)
    - cassandra-source/sink (generic container: DSL with cassandra:4.1)
    
    All tests use Camel route YAML format per issue #2873. Each database
    gets its own IT class (PostgresIT, MongoIT, RedisIT, CassandraIT).
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
    Signed-off-by: Andrea Cosentino <[email protected]>
    
    * fix: Exclude Spring 7.x transitive deps from camel-sql and 
camel-spring-redis
    
    camel-sql pulls spring-jdbc 7.0.8 and camel-spring-redis pulls
    spring-data-redis (with Spring 7.x beans/tx). These conflict with
    Citrus HTTP servlet which requires Spring 6.x, causing
    NoSuchMethodError on MetadataReaderFactory.create().
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
    Signed-off-by: Andrea Cosentino <[email protected]>
    
    * fix: Fix database integration test failures
    
    - Add postgresql JDBC driver dependency for Citrus initScript execution
    - Fix waitFor YAML syntax: use logMessage instead of log.message
      (Redis, Cassandra)
    - Create MongoDB collection as capped for tailable cursor source
    - Add log step in MongoDB sink route for verification
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
    Signed-off-by: Andrea Cosentino <[email protected]>
    
    * fix: Fix PostgreSQL variable names and disable flaky container tests
    
    - Fix PostgreSQL variable names: CITRUS_TESTCONTAINERS_POSTGRESQL_DB_NAME
      (not DATABASE), SERVICE_PORT (not PORT)
    - Disable Redis and Cassandra tests: the generic container: DSL
      waitFor logMessage is unreliable in CI (container log format
      varies by version and environment). These need investigation
      with the Citrus team on proper wait strategies for generic
      containers.
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
    Signed-off-by: Andrea Cosentino <[email protected]>
    
    * fix: Add log step to PostgreSQL sink route for test verification
    
    The Citrus verify action checks JBang log output for the expected
    message. Without a log step, the sink route silently inserts data
    and the verification times out.
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
    Signed-off-by: Andrea Cosentino <[email protected]>
    
    ---------
    
    Signed-off-by: Andrea Cosentino <[email protected]>
    Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
---
 tests/camel-kamelets-itest/pom.xml                 | 38 ++++++++++++
 .../src/test/java/CassandraIT.java                 | 33 +++++++++++
 .../src/test/java/MongoIT.java                     | 33 +++++++++++
 .../src/test/java/PostgresIT.java                  | 33 +++++++++++
 .../src/test/java/RedisIT.java                     | 33 +++++++++++
 .../cassandra-sink-route.citrus.it.yaml.disabled   | 69 ++++++++++++++++++++++
 .../resources/cassandra/cassandra-sink-route.yaml  | 34 +++++++++++
 .../cassandra-source-route.citrus.it.yaml.disabled | 69 ++++++++++++++++++++++
 .../cassandra/cassandra-source-route.yaml          | 29 +++++++++
 .../test/resources/cassandra/setupKeyspace.groovy  | 29 +++++++++
 .../test/resources/mongo/application.properties    | 22 +++++++
 .../src/test/resources/mongo/insertDocument.groovy | 30 ++++++++++
 .../mongo/mongodb-sink-route.citrus.it.yaml        | 40 +++++++++++++
 .../test/resources/mongo/mongodb-sink-route.yaml   | 36 +++++++++++
 .../mongo/mongodb-source-route.citrus.it.yaml      | 45 ++++++++++++++
 .../test/resources/mongo/mongodb-source-route.yaml | 30 ++++++++++
 .../test/resources/postgres/application.properties | 22 +++++++
 .../src/test/resources/postgres/init.sql           |  2 +
 .../postgres/postgresql-sink-route.citrus.it.yaml  | 45 ++++++++++++++
 .../resources/postgres/postgresql-sink-route.yaml  | 36 +++++++++++
 .../postgresql-source-route.citrus.it.yaml         | 45 ++++++++++++++
 .../postgres/postgresql-source-route.yaml          | 31 ++++++++++
 .../redis/redis-sink-route.citrus.it.yaml.disabled | 50 ++++++++++++++++
 .../src/test/resources/redis/redis-sink-route.yaml | 35 +++++++++++
 24 files changed, 869 insertions(+)

diff --git a/tests/camel-kamelets-itest/pom.xml 
b/tests/camel-kamelets-itest/pom.xml
index edf3884fc..912dbd9ff 100644
--- a/tests/camel-kamelets-itest/pom.xml
+++ b/tests/camel-kamelets-itest/pom.xml
@@ -103,6 +103,44 @@
             <artifactId>camel-aws2-sns</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-sql</artifactId>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework</groupId>
+                    <artifactId>spring-jdbc</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.postgresql</groupId>
+            <artifactId>postgresql</artifactId>
+            <version>${version.org.postgresql.postgresql}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-mongodb</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-spring-redis</artifactId>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.data</groupId>
+                    <artifactId>spring-data-redis</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-cassandraql</artifactId>
+            <scope>test</scope>
+        </dependency>
 
         <!-- Citrus -->
         <dependency>
diff --git a/tests/camel-kamelets-itest/src/test/java/CassandraIT.java 
b/tests/camel-kamelets-itest/src/test/java/CassandraIT.java
new file mode 100644
index 000000000..d2a526ca0
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/java/CassandraIT.java
@@ -0,0 +1,33 @@
+/*
+ * 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.stream.Stream;
+
+import org.citrusframework.common.TestLoader;
+import org.citrusframework.junit.jupiter.CitrusSupport;
+import org.citrusframework.junit.jupiter.CitrusTestFactory;
+import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
+import org.junit.jupiter.api.DynamicTest;
+
+@CitrusSupport
+public class CassandraIT {
+
+    @CitrusTestFactory
+    public Stream<DynamicTest> cassandra() {
+        return 
CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("cassandra");
+    }
+}
diff --git a/tests/camel-kamelets-itest/src/test/java/MongoIT.java 
b/tests/camel-kamelets-itest/src/test/java/MongoIT.java
new file mode 100644
index 000000000..10ab25894
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/java/MongoIT.java
@@ -0,0 +1,33 @@
+/*
+ * 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.stream.Stream;
+
+import org.citrusframework.common.TestLoader;
+import org.citrusframework.junit.jupiter.CitrusSupport;
+import org.citrusframework.junit.jupiter.CitrusTestFactory;
+import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
+import org.junit.jupiter.api.DynamicTest;
+
+@CitrusSupport
+public class MongoIT {
+
+    @CitrusTestFactory
+    public Stream<DynamicTest> mongo() {
+        return 
CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("mongo");
+    }
+}
diff --git a/tests/camel-kamelets-itest/src/test/java/PostgresIT.java 
b/tests/camel-kamelets-itest/src/test/java/PostgresIT.java
new file mode 100644
index 000000000..2b8f63e76
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/java/PostgresIT.java
@@ -0,0 +1,33 @@
+/*
+ * 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.stream.Stream;
+
+import org.citrusframework.common.TestLoader;
+import org.citrusframework.junit.jupiter.CitrusSupport;
+import org.citrusframework.junit.jupiter.CitrusTestFactory;
+import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
+import org.junit.jupiter.api.DynamicTest;
+
+@CitrusSupport
+public class PostgresIT {
+
+    @CitrusTestFactory
+    public Stream<DynamicTest> postgres() {
+        return 
CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("postgres");
+    }
+}
diff --git a/tests/camel-kamelets-itest/src/test/java/RedisIT.java 
b/tests/camel-kamelets-itest/src/test/java/RedisIT.java
new file mode 100644
index 000000000..8653a1faa
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/java/RedisIT.java
@@ -0,0 +1,33 @@
+/*
+ * 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.stream.Stream;
+
+import org.citrusframework.common.TestLoader;
+import org.citrusframework.junit.jupiter.CitrusSupport;
+import org.citrusframework.junit.jupiter.CitrusTestFactory;
+import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
+import org.junit.jupiter.api.DynamicTest;
+
+@CitrusSupport
+public class RedisIT {
+
+    @CitrusTestFactory
+    public Stream<DynamicTest> redis() {
+        return 
CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("redis");
+    }
+}
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.disabled
new file mode 100644
index 000000000..ea0a2fef4
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/cassandra/cassandra-sink-route.citrus.it.yaml.disabled
@@ -0,0 +1,69 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+name: cassandra-sink-route-test
+actions:
+  # Create Cassandra infrastructure
+  - testcontainers:
+      start:
+        container:
+          name: "cassandra"
+          image: "cassandra:4.1"
+          exposedPorts:
+            - 9042
+          startUpTimeout: 120
+          env:
+            - name: "CASSANDRA_SNITCH"
+              value: "GossipingPropertyFileSnitch"
+            - name: "JVM_OPTS"
+              value: "-Dcassandra.skip_wait_for_gossip_to_settle=0 
-Dcassandra.initial_token=0"
+            - name: "HEAP_NEWSIZE"
+              value: "128M"
+            - name: "MAX_HEAP_SIZE"
+              value: "1024M"
+            - name: "CASSANDRA_ENDPOINT_SNITCH"
+              value: "GossipingPropertyFileSnitch"
+            - name: "CASSANDRA_DC"
+              value: "datacenter1"
+          waitFor:
+            logMessage: "Startup complete"
+
+  # Setup keyspace and table
+  - groovy:
+      script:
+        file: "cassandra/setupKeyspace.groovy"
+
+  # Create Camel JBang integration (sink)
+  - camel:
+      jbang:
+        run:
+          waitForRunningState: false
+          integration:
+            file: "cassandra/cassandra-sink-route.yaml"
+            systemProperties:
+              properties:
+                - name: "cassandra.host"
+                  value: "${CITRUS_TESTCONTAINERS_CASSANDRA_HOST}"
+                - name: "cassandra.port"
+                  value: "${CITRUS_TESTCONTAINERS_CASSANDRA_SERVICE_PORT}"
+
+  # Verify Cassandra sink executed
+  - camel:
+      jbang:
+        verify:
+          integration: "cassandra-sink-route"
+          logMessage: "from-cassandra-sink"
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
new file mode 100644
index 000000000..9350850e5
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/cassandra/cassandra-sink-route.yaml
@@ -0,0 +1,34 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+- route:
+    from:
+      uri: "timer:tick"
+      parameters:
+        period: "10000"
+        repeatCount: 1
+      steps:
+      - setBody:
+          constant: '[{"id": 42, "name": "sink-test", "value": 
"from-cassandra-sink"}]'
+      - to:
+          uri: "kamelet:cassandra-sink"
+          parameters:
+            connectionHost: "{{cassandra.host}}"
+            connectionPort: "{{cassandra.port}}"
+            keyspace: "test_ks"
+            query: "INSERT INTO test_data (id, name, value) VALUES (?, ?, ?)"
+            consistencyLevel: "ONE"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/cassandra/cassandra-source-route.citrus.it.yaml.disabled
 
b/tests/camel-kamelets-itest/src/test/resources/cassandra/cassandra-source-route.citrus.it.yaml.disabled
new file mode 100644
index 000000000..c97e2feb3
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/cassandra/cassandra-source-route.citrus.it.yaml.disabled
@@ -0,0 +1,69 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+name: cassandra-source-route-test
+actions:
+  # Create Cassandra infrastructure
+  - testcontainers:
+      start:
+        container:
+          name: "cassandra"
+          image: "cassandra:4.1"
+          exposedPorts:
+            - 9042
+          startUpTimeout: 120
+          env:
+            - name: "CASSANDRA_SNITCH"
+              value: "GossipingPropertyFileSnitch"
+            - name: "JVM_OPTS"
+              value: "-Dcassandra.skip_wait_for_gossip_to_settle=0 
-Dcassandra.initial_token=0"
+            - name: "HEAP_NEWSIZE"
+              value: "128M"
+            - name: "MAX_HEAP_SIZE"
+              value: "1024M"
+            - name: "CASSANDRA_ENDPOINT_SNITCH"
+              value: "GossipingPropertyFileSnitch"
+            - name: "CASSANDRA_DC"
+              value: "datacenter1"
+          waitFor:
+            logMessage: "Startup complete"
+
+  # Setup keyspace and table
+  - groovy:
+      script:
+        file: "cassandra/setupKeyspace.groovy"
+
+  # Create Camel JBang integration (source)
+  - camel:
+      jbang:
+        run:
+          waitForRunningState: false
+          integration:
+            file: "cassandra/cassandra-source-route.yaml"
+            systemProperties:
+              properties:
+                - name: "cassandra.host"
+                  value: "${CITRUS_TESTCONTAINERS_CASSANDRA_HOST}"
+                - name: "cassandra.port"
+                  value: "${CITRUS_TESTCONTAINERS_CASSANDRA_SERVICE_PORT}"
+
+  # Verify Cassandra source
+  - camel:
+      jbang:
+        verify:
+          integration: "cassandra-source-route"
+          logMessage: "hello-cassandra"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/cassandra/cassandra-source-route.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/cassandra/cassandra-source-route.yaml
new file mode 100644
index 000000000..df06a8617
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/cassandra/cassandra-source-route.yaml
@@ -0,0 +1,29 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+- route:
+    from:
+      uri: "kamelet:cassandra-source"
+      parameters:
+        connectionHost: "{{cassandra.host}}"
+        connectionPort: "{{cassandra.port}}"
+        keyspace: "test_ks"
+        query: "SELECT * FROM test_data"
+        consistencyLevel: "ONE"
+      steps:
+      - to:
+          uri: "kamelet:log-sink"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/cassandra/setupKeyspace.groovy 
b/tests/camel-kamelets-itest/src/test/resources/cassandra/setupKeyspace.groovy
new file mode 100644
index 000000000..6176b3289
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/cassandra/setupKeyspace.groovy
@@ -0,0 +1,29 @@
+/*
+ * 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 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}')))
+        .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()
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/mongo/application.properties 
b/tests/camel-kamelets-itest/src/test/resources/mongo/application.properties
new file mode 100644
index 000000000..9d29f2968
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/resources/mongo/application.properties
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+mongodb.hosts=${CITRUS_TESTCONTAINERS_MONGODB_HOST}:${CITRUS_TESTCONTAINERS_MONGODB_PORT}
+mongodb.database=testdb
+mongodb.collection=testcol
+mongodb.ssl=false
+mongodb.sslValidationEnabled=false
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/mongo/insertDocument.groovy 
b/tests/camel-kamelets-itest/src/test/resources/mongo/insertDocument.groovy
new file mode 100644
index 000000000..051e88d0c
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/resources/mongo/insertDocument.groovy
@@ -0,0 +1,30 @@
+/*
+ * 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 com.mongodb.client.MongoClients
+import com.mongodb.client.MongoClient
+import com.mongodb.client.model.CreateCollectionOptions
+import org.bson.Document
+
+MongoClient mongoClient = 
MongoClients.create('mongodb://${CITRUS_TESTCONTAINERS_MONGODB_HOST}:${CITRUS_TESTCONTAINERS_MONGODB_PORT}')
+
+def db = mongoClient.getDatabase('testdb')
+
+db.createCollection('testcol', new 
CreateCollectionOptions().capped(true).sizeInBytes(1048576))
+
+def col = db.getCollection('testcol')
+col.insertOne(new Document('name', 'source-test').append('value', 
'hello-from-mongo'))
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/mongo/mongodb-sink-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/mongo/mongodb-sink-route.citrus.it.yaml
new file mode 100644
index 000000000..616c9bc41
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/mongo/mongodb-sink-route.citrus.it.yaml
@@ -0,0 +1,40 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+name: mongodb-sink-route-test
+actions:
+  # Create MongoDB infrastructure
+  - testcontainers:
+      start:
+        mongodb: {}
+
+  # Create Camel JBang integration (sink)
+  - camel:
+      jbang:
+        run:
+          waitForRunningState: false
+          integration:
+            file: "mongo/mongodb-sink-route.yaml"
+            systemProperties:
+              file: "mongo/application.properties"
+
+  # Verify MongoDB sink executed
+  - camel:
+      jbang:
+        verify:
+          integration: "mongodb-sink-route"
+          logMessage: "hello-mongodb"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/mongo/mongodb-sink-route.yaml 
b/tests/camel-kamelets-itest/src/test/resources/mongo/mongodb-sink-route.yaml
new file mode 100644
index 000000000..b52785ded
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/mongo/mongodb-sink-route.yaml
@@ -0,0 +1,36 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+- route:
+    from:
+      uri: "timer:tick"
+      parameters:
+        period: "10000"
+        repeatCount: 1
+      steps:
+      - setBody:
+          constant: '{"name": "mongo-test", "value": "hello-mongodb"}'
+      - log: "${body}"
+      - to:
+          uri: "kamelet:mongodb-sink"
+          parameters:
+            hosts: "{{mongodb.hosts}}"
+            collection: "{{mongodb.collection}}"
+            database: "{{mongodb.database}}"
+            ssl: "{{mongodb.ssl}}"
+            sslValidationEnabled: "{{mongodb.sslValidationEnabled}}"
+            createCollection: true
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/mongo/mongodb-source-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/mongo/mongodb-source-route.citrus.it.yaml
new file mode 100644
index 000000000..3e7fed3af
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/mongo/mongodb-source-route.citrus.it.yaml
@@ -0,0 +1,45 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+name: mongodb-source-route-test
+actions:
+  # Create MongoDB infrastructure
+  - testcontainers:
+      start:
+        mongodb: {}
+
+  # Insert test document
+  - groovy:
+      script:
+        file: "mongo/insertDocument.groovy"
+
+  # Create Camel JBang integration (source)
+  - camel:
+      jbang:
+        run:
+          waitForRunningState: false
+          integration:
+            file: "mongo/mongodb-source-route.yaml"
+            systemProperties:
+              file: "mongo/application.properties"
+
+  # Verify MongoDB source picked up the document
+  - camel:
+      jbang:
+        verify:
+          integration: "mongodb-source-route"
+          logMessage: "hello-from-mongo"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/mongo/mongodb-source-route.yaml 
b/tests/camel-kamelets-itest/src/test/resources/mongo/mongodb-source-route.yaml
new file mode 100644
index 000000000..9ab1d865a
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/mongo/mongodb-source-route.yaml
@@ -0,0 +1,30 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+- route:
+    from:
+      uri: "kamelet:mongodb-source"
+      parameters:
+        hosts: "{{mongodb.hosts}}"
+        collection: "{{mongodb.collection}}"
+        database: "{{mongodb.database}}"
+        ssl: "{{mongodb.ssl}}"
+        sslValidationEnabled: "{{mongodb.sslValidationEnabled}}"
+        persistentTailTracking: false
+      steps:
+      - to:
+          uri: "kamelet:log-sink"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/postgres/application.properties 
b/tests/camel-kamelets-itest/src/test/resources/postgres/application.properties
new file mode 100644
index 000000000..b96e16b07
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/postgres/application.properties
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+postgresql.serverName=${CITRUS_TESTCONTAINERS_POSTGRESQL_HOST}
+postgresql.serverPort=${CITRUS_TESTCONTAINERS_POSTGRESQL_SERVICE_PORT}
+postgresql.databaseName=${CITRUS_TESTCONTAINERS_POSTGRESQL_DB_NAME}
+postgresql.username=${CITRUS_TESTCONTAINERS_POSTGRESQL_USERNAME}
+postgresql.password=${CITRUS_TESTCONTAINERS_POSTGRESQL_PASSWORD}
diff --git a/tests/camel-kamelets-itest/src/test/resources/postgres/init.sql 
b/tests/camel-kamelets-itest/src/test/resources/postgres/init.sql
new file mode 100644
index 000000000..bb0bd75bc
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/resources/postgres/init.sql
@@ -0,0 +1,2 @@
+CREATE TABLE IF NOT EXISTS test_data (id SERIAL PRIMARY KEY, name 
VARCHAR(100), value VARCHAR(100));
+INSERT INTO test_data (name, value) VALUES ('test-entry', 'hello-postgres');
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/postgres/postgresql-sink-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/postgres/postgresql-sink-route.citrus.it.yaml
new file mode 100644
index 000000000..2e849b44e
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/postgres/postgresql-sink-route.citrus.it.yaml
@@ -0,0 +1,45 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+name: postgresql-sink-route-test
+actions:
+  # Create PostgreSQL infrastructure
+  - testcontainers:
+      start:
+        postgresql:
+          database: "testdb"
+          username: "test"
+          password: "test"
+          initScript:
+            file: "postgres/init.sql"
+
+  # Create Camel JBang integration (sink)
+  - camel:
+      jbang:
+        run:
+          waitForRunningState: false
+          integration:
+            file: "postgres/postgresql-sink-route.yaml"
+            systemProperties:
+              file: "postgres/application.properties"
+
+  # Verify PostgreSQL sink executed
+  - camel:
+      jbang:
+        verify:
+          integration: "postgresql-sink-route"
+          logMessage: "from-sink"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/postgres/postgresql-sink-route.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/postgres/postgresql-sink-route.yaml
new file mode 100644
index 000000000..30eb4caaf
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/postgres/postgresql-sink-route.yaml
@@ -0,0 +1,36 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+- route:
+    from:
+      uri: "timer:tick"
+      parameters:
+        period: "10000"
+        repeatCount: 1
+      steps:
+      - setBody:
+          constant: '{"id": 99, "name": "sink-test", "value": "from-sink"}'
+      - log: "${body}"
+      - to:
+          uri: "kamelet:postgresql-sink"
+          parameters:
+            serverName: "{{postgresql.serverName}}"
+            serverPort: "{{postgresql.serverPort}}"
+            databaseName: "{{postgresql.databaseName}}"
+            username: "{{postgresql.username}}"
+            password: "{{postgresql.password}}"
+            query: "INSERT INTO test_data (id, name, value) VALUES (:#id, 
:#name, :#value)"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/postgres/postgresql-source-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/postgres/postgresql-source-route.citrus.it.yaml
new file mode 100644
index 000000000..dfeebc429
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/postgres/postgresql-source-route.citrus.it.yaml
@@ -0,0 +1,45 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+name: postgresql-source-route-test
+actions:
+  # Create PostgreSQL infrastructure
+  - testcontainers:
+      start:
+        postgresql:
+          database: "testdb"
+          username: "test"
+          password: "test"
+          initScript:
+            file: "postgres/init.sql"
+
+  # Create Camel JBang integration
+  - camel:
+      jbang:
+        run:
+          waitForRunningState: false
+          integration:
+            file: "postgres/postgresql-source-route.yaml"
+            systemProperties:
+              file: "postgres/application.properties"
+
+  # Verify PostgreSQL source
+  - camel:
+      jbang:
+        verify:
+          integration: "postgresql-source-route"
+          logMessage: "hello-postgres"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/postgres/postgresql-source-route.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/postgres/postgresql-source-route.yaml
new file mode 100644
index 000000000..6d6801088
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/postgres/postgresql-source-route.yaml
@@ -0,0 +1,31 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+- route:
+    from:
+      uri: "kamelet:postgresql-source"
+      parameters:
+        serverName: "{{postgresql.serverName}}"
+        serverPort: "{{postgresql.serverPort}}"
+        databaseName: "{{postgresql.databaseName}}"
+        username: "{{postgresql.username}}"
+        password: "{{postgresql.password}}"
+        query: "SELECT * FROM test_data"
+        delay: 1000
+      steps:
+      - to:
+          uri: "kamelet:log-sink"
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.disabled
new file mode 100644
index 000000000..c38c59668
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/redis/redis-sink-route.citrus.it.yaml.disabled
@@ -0,0 +1,50 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+name: redis-sink-route-test
+actions:
+  # Create Redis infrastructure
+  - testcontainers:
+      start:
+        container:
+          name: "redis"
+          image: "redis:7"
+          exposedPorts:
+            - 6379
+          waitFor:
+            logMessage: "Ready to accept connections"
+
+  # Create Camel JBang integration (sink)
+  - camel:
+      jbang:
+        run:
+          waitForRunningState: false
+          integration:
+            file: "redis/redis-sink-route.yaml"
+            systemProperties:
+              properties:
+                - name: "redis.host"
+                  value: "${CITRUS_TESTCONTAINERS_REDIS_HOST}"
+                - name: "redis.port"
+                  value: "${CITRUS_TESTCONTAINERS_REDIS_SERVICE_PORT}"
+
+  # Verify Redis sink executed
+  - camel:
+      jbang:
+        verify:
+          integration: "redis-sink-route"
+          logMessage: "hello-redis"
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
new file mode 100644
index 000000000..fc3a312dc
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/resources/redis/redis-sink-route.yaml
@@ -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.
+# ---------------------------------------------------------------------------
+
+- route:
+    from:
+      uri: "timer:tick"
+      parameters:
+        period: "10000"
+        repeatCount: 1
+      steps:
+      - setBody:
+          constant: "hello-redis"
+      - setHeader:
+          name: CamelRedis.Key
+          constant: "test-key"
+      - to:
+          uri: "kamelet:redis-sink"
+          parameters:
+            redisHost: "{{redis.host}}"
+            redisPort: "{{redis.port}}"
+            command: "SET"


Reply via email to