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 b69d9d50e chore: Citrus tests for the Search, Cache and NoSQL Kamelets
that had none (#3261) (#3270)
b69d9d50e is described below
commit b69d9d50ea12a43af45deedcc70119f0958644f5
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Nov 19 16:01:08 2026 +0100
chore: Citrus tests for the Search, Cache and NoSQL Kamelets that had none
(#3261) (#3270)
Tests for elasticsearch-index-sink, opensearch-index-sink, solr-sink,
solr-source, infinispan-sink, infinispan-source, redis-source,
couchbase-sink and mongodb-changes-stream-source, each against the server
in a container. A sink test reads the stored data back (REST API, query
service or the component); a source test checks the body and the documented
headers. Each test also checks the Java type of the body and the
Content-Type that the Kamelet gives, so the data types of #3117 show what
they change.
New SearchIT and InfinispanIT; RedisIT, CouchbaseIT and MongoIT get an
HTTP server for the new tests.
Co-authored-by: Claude Opus 5.5 <[email protected]>
---
.../src/test/java/CouchbaseIT.java | 35 +++++
.../src/test/java/InfinispanIT.java | 68 ++++++++++
.../src/test/java/MongoIT.java | 35 +++++
.../src/test/java/RedisIT.java | 35 +++++
.../src/test/java/SearchIT.java | 78 +++++++++++
.../couchbase/couchbase-sink-route.citrus.it.yaml | 101 ++++++++++++++
.../resources/couchbase/couchbase-sink-route.yaml | 50 +++++++
.../elasticsearch-index-sink-route.citrus.it.yaml | 90 +++++++++++++
.../elasticsearch-index-sink-route.yaml | 49 +++++++
.../test/resources/infinispan/createCache.groovy | 45 +++++++
.../infinispan-sink-route.citrus.it.yaml | 74 +++++++++++
.../infinispan/infinispan-sink-route.yaml | 59 ++++++++
.../infinispan-source-route.citrus.it.yaml | 88 ++++++++++++
.../infinispan/infinispan-source-route.yaml | 65 +++++++++
.../src/test/resources/mongo/changeOrder.groovy | 47 +++++++
...godb-changes-stream-source-route.citrus.it.yaml | 148 +++++++++++++++++++++
.../mongo/mongodb-changes-stream-source-route.yaml | 42 ++++++
.../opensearch-index-sink-route.citrus.it.yaml | 92 +++++++++++++
.../opensearch/opensearch-index-sink-route.yaml | 49 +++++++
.../src/test/resources/redis/publish.groovy | 40 ++++++
.../redis/redis-source-route.citrus.it.yaml | 76 +++++++++++
.../test/resources/redis/redis-source-route.yaml | 38 ++++++
.../resources/solr/solr-sink-route.citrus.it.yaml | 84 ++++++++++++
.../src/test/resources/solr/solr-sink-route.yaml | 43 ++++++
.../solr/solr-source-route.citrus.it.yaml | 85 ++++++++++++
.../src/test/resources/solr/solr-source-route.yaml | 35 +++++
26 files changed, 1651 insertions(+)
diff --git a/tests/camel-kamelets-itest/src/test/java/CouchbaseIT.java
b/tests/camel-kamelets-itest/src/test/java/CouchbaseIT.java
index 101dc584c..a6fd85fa0 100644
--- a/tests/camel-kamelets-itest/src/test/java/CouchbaseIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/CouchbaseIT.java
@@ -18,14 +18,49 @@
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.citrusframework.util.SocketUtils;
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 CouchbaseIT {
+ private static final String TESTS = "couchbase-.*";
+
+ private final int couchbaseServerPort = SocketUtils.findAvailableTcpPort();
+
+ @BindToRegistry
+ HttpServer couchbaseServer = http()
+ .server()
+ .port(couchbaseServerPort)
+ .timeout(60000L)
+ .autoStart(true)
+ .build();
+
+ @BindToRegistry
+ public SequenceBeforeTest beforeCouchbase() {
+ return new SequenceBeforeTest.Builder().onTests(TESTS).actions(
+ createVariables().variable("couchbase.server.port",
String.valueOf(couchbaseServerPort))
+ ).build();
+ }
+
+ @BindToRegistry
+ public SequenceAfterTest afterCouchbase() {
+ return new SequenceAfterTest.Builder().onTests(TESTS).actions(
+ purgeEndpoints().endpoint(couchbaseServer)
+ ).build();
+ }
+
@CitrusTestFactory
public Stream<DynamicTest> couchbase() {
return
CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("couchbase");
diff --git a/tests/camel-kamelets-itest/src/test/java/InfinispanIT.java
b/tests/camel-kamelets-itest/src/test/java/InfinispanIT.java
new file mode 100644
index 000000000..2554ab7fc
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/java/InfinispanIT.java
@@ -0,0 +1,68 @@
+/*
+ * 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.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.citrusframework.util.SocketUtils;
+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 InfinispanIT {
+
+ private static final String TESTS = "infinispan-.*";
+
+ private final int infinispanServerPort =
SocketUtils.findAvailableTcpPort();
+
+ @BindToRegistry
+ HttpServer infinispanServer = http()
+ .server()
+ .port(infinispanServerPort)
+ .timeout(60000L)
+ .autoStart(true)
+ .build();
+
+ @BindToRegistry
+ public SequenceBeforeTest beforeInfinispan() {
+ return new SequenceBeforeTest.Builder().onTests(TESTS).actions(
+ createVariables().variable("infinispan.server.port",
String.valueOf(infinispanServerPort))
+ ).build();
+ }
+
+ @BindToRegistry
+ public SequenceAfterTest afterInfinispan() {
+ return new SequenceAfterTest.Builder().onTests(TESTS).actions(
+ purgeEndpoints().endpoint(infinispanServer)
+ ).build();
+ }
+
+ @CitrusTestFactory
+ public Stream<DynamicTest> infinispan() {
+ return
CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("infinispan");
+ }
+}
diff --git a/tests/camel-kamelets-itest/src/test/java/MongoIT.java
b/tests/camel-kamelets-itest/src/test/java/MongoIT.java
index f30c362bf..9b051217f 100644
--- a/tests/camel-kamelets-itest/src/test/java/MongoIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/MongoIT.java
@@ -18,14 +18,49 @@
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.citrusframework.util.SocketUtils;
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 MongoIT {
+ private static final String TESTS = "mongodb-.*";
+
+ private final int mongoServerPort = SocketUtils.findAvailableTcpPort();
+
+ @BindToRegistry
+ HttpServer mongoServer = http()
+ .server()
+ .port(mongoServerPort)
+ .timeout(60000L)
+ .autoStart(true)
+ .build();
+
+ @BindToRegistry
+ public SequenceBeforeTest beforeMongo() {
+ return new SequenceBeforeTest.Builder().onTests(TESTS).actions(
+ createVariables().variable("mongo.server.port",
String.valueOf(mongoServerPort))
+ ).build();
+ }
+
+ @BindToRegistry
+ public SequenceAfterTest afterMongo() {
+ return new SequenceAfterTest.Builder().onTests(TESTS).actions(
+ purgeEndpoints().endpoint(mongoServer)
+ ).build();
+ }
+
@CitrusTestFactory
public Stream<DynamicTest> mongo() {
return
CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("mongo");
diff --git a/tests/camel-kamelets-itest/src/test/java/RedisIT.java
b/tests/camel-kamelets-itest/src/test/java/RedisIT.java
index 7473f5bdc..f4775b50b 100644
--- a/tests/camel-kamelets-itest/src/test/java/RedisIT.java
+++ b/tests/camel-kamelets-itest/src/test/java/RedisIT.java
@@ -18,14 +18,49 @@
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.citrusframework.util.SocketUtils;
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 RedisIT {
+ private static final String TESTS = "redis-.*";
+
+ private final int redisServerPort = SocketUtils.findAvailableTcpPort();
+
+ @BindToRegistry
+ HttpServer redisServer = http()
+ .server()
+ .port(redisServerPort)
+ .timeout(60000L)
+ .autoStart(true)
+ .build();
+
+ @BindToRegistry
+ public SequenceBeforeTest beforeRedis() {
+ return new SequenceBeforeTest.Builder().onTests(TESTS).actions(
+ createVariables().variable("redis.server.port",
String.valueOf(redisServerPort))
+ ).build();
+ }
+
+ @BindToRegistry
+ public SequenceAfterTest afterRedis() {
+ return new SequenceAfterTest.Builder().onTests(TESTS).actions(
+ purgeEndpoints().endpoint(redisServer)
+ ).build();
+ }
+
@CitrusTestFactory
public Stream<DynamicTest> redis() {
return
CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("redis");
diff --git a/tests/camel-kamelets-itest/src/test/java/SearchIT.java
b/tests/camel-kamelets-itest/src/test/java/SearchIT.java
new file mode 100644
index 000000000..54906a9c0
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/java/SearchIT.java
@@ -0,0 +1,78 @@
+/*
+ * 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.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.citrusframework.util.SocketUtils;
+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 SearchIT {
+
+ private static final String TESTS = "(elasticsearch|opensearch|solr)-.*";
+
+ private final int searchServerPort = SocketUtils.findAvailableTcpPort();
+
+ @BindToRegistry
+ HttpServer searchServer = http()
+ .server()
+ .port(searchServerPort)
+ .timeout(60000L)
+ .autoStart(true)
+ .build();
+
+ @BindToRegistry
+ public SequenceBeforeTest beforeSearch() {
+ return new SequenceBeforeTest.Builder().onTests(TESTS).actions(
+ createVariables().variable("search.server.port",
String.valueOf(searchServerPort))
+ ).build();
+ }
+
+ @BindToRegistry
+ public SequenceAfterTest afterSearch() {
+ return new SequenceAfterTest.Builder().onTests(TESTS).actions(
+ purgeEndpoints().endpoint(searchServer)
+ ).build();
+ }
+
+ @CitrusTestFactory
+ public Stream<DynamicTest> elasticsearch() {
+ return
CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("elasticsearch");
+ }
+
+ @CitrusTestFactory
+ public Stream<DynamicTest> opensearch() {
+ return
CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("opensearch");
+ }
+
+ @CitrusTestFactory
+ public Stream<DynamicTest> solr() {
+ return
CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("solr");
+ }
+}
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
new file mode 100644
index 000000000..ea11bccce
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/couchbase/couchbase-sink-route.citrus.it.yaml
@@ -0,0 +1,101 @@
+# ---------------------------------------------------------------------------
+# 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: 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.
+ - testcontainers:
+ start:
+ container:
+ name: "couchbase"
+ image: "couchbase/server:community-7.6.2"
+ startUpTimeout: 300
+ portBindings:
+ - "8091:8091"
+ - "8093:8093"
+ - "11210:11210"
+ waitFor:
+ logMessage: ".*Starting Couchbase Server.*"
+
+ # Initialise the cluster, create the bucket (and seed one document, not used
here)
+ - groovy:
+ script:
+ file: "couchbase/initCluster.groovy"
+
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "couchbase/couchbase-sink-route.yaml"
+ systemProperties:
+ file: "couchbase/application.properties"
+ properties:
+ - name: "http.sink.url"
+ value: "http://localhost:${couchbase.server.port}"
+
+ # the body afterwards is true
+ - http:
+ server: "couchbaseServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ type: "plaintext"
+ headers:
+ - name: "X-Body-Type"
+ value: 'java.lang.Boolean'
+ - name: "X-Content-Type"
+ value: 'ct='
+ body:
+ data: 'true'
+ - http:
+ server: "couchbaseServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+
+ # the document is stored as a JSON document, under the id of the
CamelCouchbaseId header
+ - http:
+ client: "http://localhost:8093"
+ sendRequest:
+ POST:
+ path: "/query/service"
+ contentType: "application/json"
+ headers:
+ - name: "Authorization"
+ value: "Basic citrus:encodeBase64('Administrator:password')"
+ body:
+ data: '{"statement":"SELECT RAW k FROM `kamelets` k USE KEYS
''order-1''"}'
+ - http:
+ client: "http://localhost:8093"
+ receiveResponse:
+ response:
+ status: 200
+ validate:
+ - jsonPath:
+ - expression: "$.results[0].order"
+ value: "ORD-1"
+ - expression: "$.results[0].status"
+ value: "shipped"
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
new file mode 100644
index 000000000..d9b8c4c63
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/couchbase/couchbase-sink-route.yaml
@@ -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.
+# ---------------------------------------------------------------------------
+
+- route:
+ from:
+ uri: "timer:tick"
+ parameters:
+ period: "1000"
+ repeatCount: 1
+ steps:
+ - setHeader:
+ name: CamelCouchbaseId
+ constant: 'order-1'
+ - setBody:
+ constant: '{"order":"ORD-1","status":"shipped"}'
+ - to:
+ uri: "kamelet:couchbase-sink"
+ parameters:
+ protocol: "{{couchbase.protocol}}"
+ couchbaseHostname: "{{couchbase.hostname}}"
+ bucket: "{{couchbase.bucket}}"
+ username: "{{couchbase.username}}"
+ password: "{{couchbase.password}}"
+ autoStartId: false
+ # 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 cannot send a Boolean body
+ - convertBodyTo:
+ type: "java.lang.String"
+ - to:
+ uri: "{{http.sink.url}}/result"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/elasticsearch/elasticsearch-index-sink-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/elasticsearch/elasticsearch-index-sink-route.citrus.it.yaml
new file mode 100644
index 000000000..fa0313288
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/elasticsearch/elasticsearch-index-sink-route.citrus.it.yaml
@@ -0,0 +1,90 @@
+# ---------------------------------------------------------------------------
+# 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: elasticsearch-index-sink-route-test
+actions:
+ # Elasticsearch with one node and security off, so it is reached with plain
HTTP
+ - testcontainers:
+ start:
+ container:
+ name: "elasticsearch"
+ image: "docker.elastic.co/elasticsearch/elasticsearch:9.1.0"
+ startUpTimeout: 180
+ exposedPorts:
+ - 9200
+ env:
+ - name: "discovery.type"
+ value: "single-node"
+ - name: "xpack.security.enabled"
+ value: "false"
+ - name: "cluster.routing.allocation.disk.threshold_enabled"
+ value: "false"
+ - name: "ES_JAVA_OPTS"
+ value: "-Xms512m -Xmx512m"
+ waitFor:
+ url: "http://localhost:9200/"
+
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "elasticsearch/elasticsearch-index-sink-route.yaml"
+ systemProperties:
+ properties:
+ - name: "elasticsearch.host"
+ value: "${CITRUS_TESTCONTAINERS_ELASTICSEARCH_HOST}"
+ - name: "elasticsearch.port"
+ value: "${CITRUS_TESTCONTAINERS_ELASTICSEARCH_PORT}"
+ - name: "http.sink.url"
+ value: "http://localhost:${search.server.port}"
+
+ # the body afterwards is the id of the document
+ - http:
+ server: "searchServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ type: "plaintext"
+ headers:
+ - name: "X-Body-Type"
+ value: 'java.lang.String'
+ - name: "X-Content-Type"
+ value: 'ct='
+ body:
+ data: 'order-1'
+ - http:
+ server: "searchServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+
+ # the document is stored under its id, in the index of the header
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_ELASTICSEARCH_HOST}:${CITRUS_TESTCONTAINERS_ELASTICSEARCH_PORT}"
+ sendRequest:
+ GET:
+ path: "/orders/_doc/order-1"
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_ELASTICSEARCH_HOST}:${CITRUS_TESTCONTAINERS_ELASTICSEARCH_PORT}"
+ receiveResponse:
+ response:
+ status: 200
+ body:
+ data:
'{"_index":"orders","_id":"order-1","_version":1,"_seq_no":"@ignore@","_primary_term":"@ignore@","found":true,"_source":{"order":"ORD-1","status":"shipped"}}'
diff --git
a/tests/camel-kamelets-itest/src/test/resources/elasticsearch/elasticsearch-index-sink-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/elasticsearch/elasticsearch-index-sink-route.yaml
new file mode 100644
index 000000000..4de225c81
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/elasticsearch/elasticsearch-index-sink-route.yaml
@@ -0,0 +1,49 @@
+# ---------------------------------------------------------------------------
+# 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: "1000"
+ repeatCount: 1
+ steps:
+ - setHeader:
+ name: indexId
+ constant: 'order-1'
+ # the header takes precedence over the indexName option
+ - setHeader:
+ name: indexName
+ constant: 'orders'
+ - setBody:
+ constant: '{"order":"ORD-1","status":"shipped"}'
+ - to:
+ uri: "kamelet:elasticsearch-index-sink"
+ parameters:
+ hostAddresses: '{{elasticsearch.host}}:{{elasticsearch.port}}'
+ clusterName: 'docker-cluster'
+ indexName: 'other'
+ enableSSL: false
+ # 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}"
+ - to:
+ uri: "{{http.sink.url}}/result"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/infinispan/createCache.groovy
b/tests/camel-kamelets-itest/src/test/resources/infinispan/createCache.groovy
new file mode 100644
index 000000000..720ecc247
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/infinispan/createCache.groovy
@@ -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.
+ */
+// Creates the cache "kamelets" on the Infinispan server, as the Infinispan
+// Kamelets need a cache that already exists.
+//
+// - the REST API of Infinispan asks for a Digest login, which
HttpURLConnection
+// answers through an Authenticator
+// - a local cache, so the server sends the client no cluster topology with
the
+// container address, which the client could not reach
+// - string concatenation rather than Groovy GStrings, because Citrus resolves
+// dollar-brace expressions in these scripts as its own test variables
+
+def url =
'http://${CITRUS_TESTCONTAINERS_INFINISPAN_HOST}:${CITRUS_TESTCONTAINERS_INFINISPAN_PORT}/rest/v2/caches/kamelets'
+
+def conn = (HttpURLConnection) new URL(url).openConnection()
+conn.authenticator = new Authenticator() {
+ @Override
+ protected PasswordAuthentication getPasswordAuthentication() {
+ return new PasswordAuthentication('admin', 'password'.toCharArray())
+ }
+}
+conn.requestMethod = 'POST'
+conn.doOutput = true
+conn.connectTimeout = 10000
+conn.readTimeout = 30000
+conn.setRequestProperty('Content-Type', 'application/json')
+conn.outputStream.withWriter { it << '{"local-cache":{}}' }
+def code = conn.responseCode
+if (code >= 300) {
+ throw new IllegalStateException('POST ' + url + ' failed with ' + code)
+}
diff --git
a/tests/camel-kamelets-itest/src/test/resources/infinispan/infinispan-sink-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/infinispan/infinispan-sink-route.citrus.it.yaml
new file mode 100644
index 000000000..106cb573f
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/infinispan/infinispan-sink-route.citrus.it.yaml
@@ -0,0 +1,74 @@
+# ---------------------------------------------------------------------------
+# 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: infinispan-sink-route-test
+actions:
+ # Infinispan server with the user admin
+ - testcontainers:
+ start:
+ container:
+ name: "infinispan"
+ image: "quay.io/infinispan/server:16.3"
+ startUpTimeout: 180
+ exposedPorts:
+ - 11222
+ env:
+ - name: "USER"
+ value: "admin"
+ - name: "PASS"
+ value: "password"
+ waitFor:
+ url: "http://localhost:11222/rest/v2/container/health/status"
+
+ - groovy:
+ script:
+ file: "infinispan/createCache.groovy"
+
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "infinispan/infinispan-sink-route.yaml"
+ systemProperties:
+ properties:
+ - name: "infinispan.hosts"
+ value:
"${CITRUS_TESTCONTAINERS_INFINISPAN_HOST}:${CITRUS_TESTCONTAINERS_INFINISPAN_PORT}"
+ - name: "http.sink.url"
+ value: "http://localhost:${infinispan.server.port}"
+
+ # the Kamelet leaves no body; the value read back from the cache is the body
that was sent
+ - http:
+ server: "infinispanServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ type: "plaintext"
+ headers:
+ - name: "X-Body-Type"
+ value: 'null'
+ - name: "X-Content-Type"
+ value: 'ct='
+ body:
+ data: 'ORD-1 shipped'
+ - http:
+ server: "infinispanServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/infinispan/infinispan-sink-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/infinispan/infinispan-sink-route.yaml
new file mode 100644
index 000000000..76cb1cbad
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/infinispan/infinispan-sink-route.yaml
@@ -0,0 +1,59 @@
+# ---------------------------------------------------------------------------
+# 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: "1000"
+ repeatCount: 1
+ steps:
+ - setHeader:
+ name: key
+ constant: 'order-1'
+ - setBody:
+ constant: 'ORD-1 shipped'
+ - to:
+ uri: "kamelet:infinispan-sink"
+ parameters:
+ cacheName: 'kamelets'
+ hosts: '{{infinispan.hosts}}'
+ username: 'admin'
+ password: 'password'
+ saslMechanism: 'SCRAM-SHA-512'
+ # what the Kamelet gives: the Java type of the body (null when there
is no body) and the Content-Type
+ - setHeader:
+ name: X-Body-Type
+ simple: "${iif(${body} == null,null,${body.getClass().getName()})}"
+ - setHeader:
+ name: X-Content-Type
+ simple: "ct=${header.Content-Type}"
+ # read the value back from the cache, with the Infinispan component
+ - setHeader:
+ name: CamelInfinispanKey
+ constant: 'order-1'
+ - to:
+ uri: "infinispan:kamelets"
+ parameters:
+ hosts: '{{infinispan.hosts}}'
+ secure: true
+ username: 'admin'
+ password: 'password'
+ saslMechanism: 'SCRAM-SHA-512'
+ operation: 'GET'
+ - to:
+ uri: "{{http.sink.url}}/result"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/infinispan/infinispan-source-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/infinispan/infinispan-source-route.citrus.it.yaml
new file mode 100644
index 000000000..5bf301a71
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/infinispan/infinispan-source-route.citrus.it.yaml
@@ -0,0 +1,88 @@
+# ---------------------------------------------------------------------------
+# 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: infinispan-source-route-test
+actions:
+ # Infinispan server with the user admin
+ - testcontainers:
+ start:
+ container:
+ name: "infinispan"
+ image: "quay.io/infinispan/server:16.3"
+ startUpTimeout: 180
+ exposedPorts:
+ - 11222
+ env:
+ - name: "USER"
+ value: "admin"
+ - name: "PASS"
+ value: "password"
+ waitFor:
+ url: "http://localhost:11222/rest/v2/container/health/status"
+
+ - groovy:
+ script:
+ file: "infinispan/createCache.groovy"
+
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "infinispan/infinispan-source-route.yaml"
+ systemProperties:
+ properties:
+ - name: "infinispan.hosts"
+ value:
"${CITRUS_TESTCONTAINERS_INFINISPAN_HOST}:${CITRUS_TESTCONTAINERS_INFINISPAN_PORT}"
+ - name: "http.sink.url"
+ value: "http://localhost:${infinispan.server.port}"
+
+ # the event is in headers, and there is no body
+ - http:
+ server: "infinispanServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ type: "plaintext"
+ headers:
+ - name: "X-Body-Type"
+ value: 'null'
+ - name: "X-Content-Type"
+ value: 'ct='
+ - name: "infinispan-event-type"
+ value: 'CLIENT_CACHE_ENTRY_CREATED'
+ - name: "infinispan-key"
+ value: 'order-1'
+ - name: "infinispan-cache-name"
+ value: 'kamelets'
+ - name: "infinispan-entry-version"
+ value: '@isNumber()@'
+ - name: "ce-infinispaneventtype"
+ value: 'CLIENT_CACHE_ENTRY_CREATED'
+ - name: "ce-infinispankey"
+ value: 'order-1'
+ - name: "ce-infinispancachename"
+ value: 'kamelets'
+ body:
+ data: ''
+ - http:
+ server: "infinispanServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/infinispan/infinispan-source-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/infinispan/infinispan-source-route.yaml
new file mode 100644
index 000000000..528fca71b
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/infinispan/infinispan-source-route.yaml
@@ -0,0 +1,65 @@
+# ---------------------------------------------------------------------------
+# 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:infinispan-source"
+ parameters:
+ cacheName: 'kamelets'
+ hosts: '{{infinispan.hosts}}'
+ username: 'admin'
+ password: 'password'
+ saslMechanism: 'SCRAM-SHA-512'
+ eventTypes: 'CLIENT_CACHE_ENTRY_CREATED'
+ steps:
+ # what the Kamelet gives: the Java type of the body (null when there
is no body) and the Content-Type
+ - setHeader:
+ name: X-Body-Type
+ simple: "${iif(${body} == null,null,${body.getClass().getName()})}"
+ - setHeader:
+ name: X-Content-Type
+ simple: "ct=${header.Content-Type}"
+ # without a body, the HTTP component would send a GET
+ - setHeader:
+ name: CamelHttpMethod
+ constant: 'POST'
+ - to:
+ uri: "{{http.sink.url}}/result"
+
+# writes an entry, once the source above has started and listens to the cache
+- route:
+ from:
+ uri: "timer:write"
+ parameters:
+ delay: "2000"
+ repeatCount: 1
+ steps:
+ - setHeader:
+ name: CamelInfinispanKey
+ constant: 'order-1'
+ - setHeader:
+ name: CamelInfinispanValue
+ constant: 'ORD-1 shipped'
+ - to:
+ uri: "infinispan:kamelets"
+ parameters:
+ hosts: '{{infinispan.hosts}}'
+ secure: true
+ username: 'admin'
+ password: 'password'
+ saslMechanism: 'SCRAM-SHA-512'
+ operation: 'PUT'
diff --git
a/tests/camel-kamelets-itest/src/test/resources/mongo/changeOrder.groovy
b/tests/camel-kamelets-itest/src/test/resources/mongo/changeOrder.groovy
new file mode 100644
index 000000000..528499578
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/resources/mongo/changeOrder.groovy
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+// Makes one change to the collection "orders" of the database "testdb", as
+// the test variable mongodb.change says: create the collection, insert the
+// document "order-1", update it, or delete it.
+
+import com.mongodb.client.MongoClients
+import com.mongodb.client.model.Filters
+import com.mongodb.client.model.Updates
+import org.bson.Document
+
+def client =
MongoClients.create('mongodb://${CITRUS_TESTCONTAINERS_MONGODB_HOST}:${CITRUS_TESTCONTAINERS_MONGODB_PORT}')
+try {
+ def db = client.getDatabase('testdb')
+ switch ('${mongodb.change}') {
+ case 'create':
+ db.createCollection('orders')
+ break
+ case 'insert':
+ db.getCollection('orders').insertOne(new Document('_id',
'order-1').append('status', 'new'))
+ break
+ case 'update':
+ db.getCollection('orders').updateOne(Filters.eq('_id', 'order-1'),
Updates.set('status', 'shipped'))
+ break
+ case 'delete':
+ db.getCollection('orders').deleteOne(Filters.eq('_id', 'order-1'))
+ break
+ default:
+ throw new IllegalArgumentException('Unknown change:
${mongodb.change}')
+ }
+} finally {
+ client.close()
+}
diff --git
a/tests/camel-kamelets-itest/src/test/resources/mongo/mongodb-changes-stream-source-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/mongo/mongodb-changes-stream-source-route.citrus.it.yaml
new file mode 100644
index 000000000..da7f6306c
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/mongo/mongodb-changes-stream-source-route.citrus.it.yaml
@@ -0,0 +1,148 @@
+# ---------------------------------------------------------------------------
+# 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-changes-stream-source-route-test
+actions:
+ # MongoDB as a replica set with one member, as change streams need one
+ - testcontainers:
+ start:
+ mongodb: {}
+
+ # the collection must exist when the Kamelet starts
+ - createVariables:
+ variables:
+ - name: "mongodb.change"
+ value: "create"
+ - groovy:
+ script:
+ file: "mongo/changeOrder.groovy"
+
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "mongo/mongodb-changes-stream-source-route.yaml"
+ systemProperties:
+ properties:
+ - name: "mongodb.hosts"
+ value:
"${CITRUS_TESTCONTAINERS_MONGODB_HOST}:${CITRUS_TESTCONTAINERS_MONGODB_PORT}"
+ - name: "http.sink.url"
+ value: "http://localhost:${mongo.server.port}"
+
+ # only the changes made after the Kamelet started are sent
+ - camel:
+ cli:
+ verify:
+ integration: "mongodb-changes-stream-source-route"
+ logMessage: "started in"
+
+ # an insert gives the whole new document
+ - createVariables:
+ variables:
+ - name: "mongodb.change"
+ value: "insert"
+ - groovy:
+ script:
+ file: "mongo/changeOrder.groovy"
+ - http:
+ server: "mongoServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ headers:
+ - name: "X-Body-Type"
+ value: 'org.apache.camel.converter.stream.InputStreamCache'
+ - name: "X-Content-Type"
+ value: 'ct=application/json'
+ - name: "X-Operation-Type"
+ value: 'insert'
+ - name: "X-Id"
+ value: 'order-1'
+ body:
+ data: '{"_id":"order-1","status":"new"}'
+ - http:
+ server: "mongoServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+
+ # an update gives the whole document, read again from the collection
+ - createVariables:
+ variables:
+ - name: "mongodb.change"
+ value: "update"
+ - groovy:
+ script:
+ file: "mongo/changeOrder.groovy"
+ - http:
+ server: "mongoServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ headers:
+ - name: "X-Body-Type"
+ value: 'org.apache.camel.converter.stream.InputStreamCache'
+ - name: "X-Content-Type"
+ value: 'ct=application/json'
+ - name: "X-Operation-Type"
+ value: 'update'
+ - name: "X-Id"
+ value: 'order-1'
+ body:
+ data: '{"_id":"order-1","status":"shipped"}'
+ - http:
+ server: "mongoServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+
+ # a delete gives only the _id of the document
+ - createVariables:
+ variables:
+ - name: "mongodb.change"
+ value: "delete"
+ - groovy:
+ script:
+ file: "mongo/changeOrder.groovy"
+ - http:
+ server: "mongoServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ headers:
+ - name: "X-Body-Type"
+ value: 'org.apache.camel.converter.stream.InputStreamCache'
+ - name: "X-Content-Type"
+ value: 'ct=application/json'
+ - name: "X-Operation-Type"
+ value: 'delete'
+ - name: "X-Id"
+ value: 'order-1'
+ body:
+ data: '{"_id":"order-1"}'
+ - http:
+ server: "mongoServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/mongo/mongodb-changes-stream-source-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/mongo/mongodb-changes-stream-source-route.yaml
new file mode 100644
index 000000000..a4c68d313
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/mongo/mongodb-changes-stream-source-route.yaml
@@ -0,0 +1,42 @@
+# ---------------------------------------------------------------------------
+# 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-changes-stream-source"
+ parameters:
+ hosts: "{{mongodb.hosts}}"
+ database: "testdb"
+ collection: "orders"
+ ssl: false
+ 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-Operation-Type
+ simple: "${header.CamelMongoDbStreamOperationType}"
+ - setHeader:
+ name: X-Id
+ simple: "${header._id}"
+ - to:
+ uri: "{{http.sink.url}}/result"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/opensearch/opensearch-index-sink-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/opensearch/opensearch-index-sink-route.citrus.it.yaml
new file mode 100644
index 000000000..8b3d158dd
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/opensearch/opensearch-index-sink-route.citrus.it.yaml
@@ -0,0 +1,92 @@
+# ---------------------------------------------------------------------------
+# 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: opensearch-index-sink-route-test
+actions:
+ # OpenSearch with one node and the security plugin off, so it is reached
with plain HTTP
+ - testcontainers:
+ start:
+ container:
+ name: "opensearch"
+ image: "opensearchproject/opensearch:3.9.0"
+ startUpTimeout: 180
+ exposedPorts:
+ - 9200
+ env:
+ - name: "discovery.type"
+ value: "single-node"
+ - name: "DISABLE_SECURITY_PLUGIN"
+ value: "true"
+ - name: "DISABLE_INSTALL_DEMO_CONFIG"
+ value: "true"
+ - name: "cluster.routing.allocation.disk.threshold_enabled"
+ value: "false"
+ - name: "OPENSEARCH_JAVA_OPTS"
+ value: "-Xms512m -Xmx512m"
+ waitFor:
+ url: "http://localhost:9200/"
+
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "opensearch/opensearch-index-sink-route.yaml"
+ systemProperties:
+ properties:
+ - name: "opensearch.host"
+ value: "${CITRUS_TESTCONTAINERS_OPENSEARCH_HOST}"
+ - name: "opensearch.port"
+ value: "${CITRUS_TESTCONTAINERS_OPENSEARCH_PORT}"
+ - name: "http.sink.url"
+ value: "http://localhost:${search.server.port}"
+
+ # the body afterwards is the id of the document
+ - http:
+ server: "searchServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ type: "plaintext"
+ headers:
+ - name: "X-Body-Type"
+ value: 'java.lang.String'
+ - name: "X-Content-Type"
+ value: 'ct='
+ body:
+ data: 'order-1'
+ - http:
+ server: "searchServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+
+ # the document is stored under its id, in the index of the header
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_OPENSEARCH_HOST}:${CITRUS_TESTCONTAINERS_OPENSEARCH_PORT}"
+ sendRequest:
+ GET:
+ path: "/orders/_doc/order-1"
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_OPENSEARCH_HOST}:${CITRUS_TESTCONTAINERS_OPENSEARCH_PORT}"
+ receiveResponse:
+ response:
+ status: 200
+ body:
+ data:
'{"_index":"orders","_id":"order-1","_version":1,"_seq_no":"@ignore@","_primary_term":"@ignore@","found":true,"_source":{"order":"ORD-1","status":"shipped"}}'
diff --git
a/tests/camel-kamelets-itest/src/test/resources/opensearch/opensearch-index-sink-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/opensearch/opensearch-index-sink-route.yaml
new file mode 100644
index 000000000..1c849b727
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/opensearch/opensearch-index-sink-route.yaml
@@ -0,0 +1,49 @@
+# ---------------------------------------------------------------------------
+# 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: "1000"
+ repeatCount: 1
+ steps:
+ - setHeader:
+ name: indexId
+ constant: 'order-1'
+ # the header takes precedence over the indexName option
+ - setHeader:
+ name: indexName
+ constant: 'orders'
+ - setBody:
+ constant: '{"order":"ORD-1","status":"shipped"}'
+ - to:
+ uri: "kamelet:opensearch-index-sink"
+ parameters:
+ hostAddresses: '{{opensearch.host}}:{{opensearch.port}}'
+ clusterName: 'docker-cluster'
+ indexName: 'other'
+ enableSSL: false
+ # 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}"
+ - to:
+ uri: "{{http.sink.url}}/result"
diff --git a/tests/camel-kamelets-itest/src/test/resources/redis/publish.groovy
b/tests/camel-kamelets-itest/src/test/resources/redis/publish.groovy
new file mode 100644
index 000000000..5f77fe8bf
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/resources/redis/publish.groovy
@@ -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.
+ */
+// Publishes one message on the channel "orders", in the Redis protocol over a
+// plain socket, so the test module needs no Redis client.
+//
+// Redis keeps no message for a subscriber that is not there yet, and PUBLISH
+// answers with the number of subscribers that got the message. The script
fails
+// while that is 0, so that the test can repeat it until the Kamelet has
+// subscribed; the message then reaches the Kamelet exactly once.
+
+def args = ['PUBLISH', 'orders', 'ORD-1 shipped']
+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 reply = new BufferedReader(new InputStreamReader(socket.inputStream,
'UTF-8')).readLine()
+ if (reply != ':1') {
+ throw new IllegalStateException('The message reached no subscriber
yet: ' + reply)
+ }
+} finally {
+ socket.close()
+}
diff --git
a/tests/camel-kamelets-itest/src/test/resources/redis/redis-source-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/redis/redis-source-route.citrus.it.yaml
new file mode 100644
index 000000000..6f719be34
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/redis/redis-source-route.citrus.it.yaml
@@ -0,0 +1,76 @@
+# ---------------------------------------------------------------------------
+# 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-source-route-test
+variables:
+ - name: "maxRetryAttempts"
+ value: "30"
+actions:
+ - testcontainers:
+ start:
+ container:
+ name: "redis"
+ image: "redis:7.4.12-alpine"
+ exposedPorts:
+ - 6379
+
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "redis/redis-source-route.yaml"
+ systemProperties:
+ properties:
+ - name: "redis.host"
+ value: "${CITRUS_TESTCONTAINERS_REDIS_HOST}"
+ - name: "redis.port"
+ value: "${CITRUS_TESTCONTAINERS_REDIS_PORT}"
+ - name: "http.sink.url"
+ value: "http://localhost:${redis.server.port}"
+
+ # publish until the Kamelet has subscribed and gets the message
+ - repeatOnError:
+ until: "i > ${maxRetryAttempts}"
+ autoSleep: 1000
+ actions:
+ - groovy:
+ script:
+ file: "redis/publish.groovy"
+
+ - http:
+ server: "redisServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ type: "plaintext"
+ headers:
+ - name: "X-Body-Type"
+ value: 'java.lang.String'
+ - name: "X-Content-Type"
+ value: 'ct='
+ - name: "X-Channel"
+ value: 'orders'
+ body:
+ data: 'ORD-1 shipped'
+ - http:
+ server: "redisServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/redis/redis-source-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/redis/redis-source-route.yaml
new file mode 100644
index 000000000..2a49fbf7b
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/redis/redis-source-route.yaml
@@ -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.
+# ---------------------------------------------------------------------------
+
+- route:
+ from:
+ uri: "kamelet:redis-source"
+ parameters:
+ redisHost: '{{redis.host}}'
+ redisPort: '{{redis.port}}'
+ channels: 'orders'
+ 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-Channel
+ simple: "${header[CamelRedis.Channel]}"
+ - to:
+ uri: "{{http.sink.url}}/result"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/solr/solr-sink-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/solr/solr-sink-route.citrus.it.yaml
new file mode 100644
index 000000000..67d0572fe
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/solr/solr-sink-route.citrus.it.yaml
@@ -0,0 +1,84 @@
+# ---------------------------------------------------------------------------
+# 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: solr-sink-route-test
+actions:
+ # Solr in standalone mode, with the core "kamelets" created at start
+ - testcontainers:
+ start:
+ container:
+ name: "solr"
+ image: "solr:9.10.1-slim"
+ command: "solr-precreate kamelets"
+ startUpTimeout: 180
+ exposedPorts:
+ - 8983
+ waitFor:
+ url: "http://localhost:8983/solr/kamelets/admin/ping"
+
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "solr/solr-sink-route.yaml"
+ systemProperties:
+ properties:
+ - name: "solr.host"
+ value: "${CITRUS_TESTCONTAINERS_SOLR_HOST}"
+ - name: "solr.port"
+ value: "${CITRUS_TESTCONTAINERS_SOLR_PORT}"
+ - name: "http.sink.url"
+ value: "http://localhost:${search.server.port}"
+
+ # the body afterwards is the answer of Solr, with its responseHeader
+ - http:
+ server: "searchServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ headers:
+ - name: "X-Body-Type"
+ value: 'org.apache.solr.common.util.SimpleOrderedMap'
+ - name: "X-Content-Type"
+ value: 'ct='
+ body:
+ data: '{"responseHeader":{"status":0,"QTime":"@ignore@"}}'
+ - http:
+ server: "searchServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+
+ # with autocommit, the document can be searched at once
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_SOLR_HOST}:${CITRUS_TESTCONTAINERS_SOLR_PORT}"
+ sendRequest:
+ GET:
+ path: "/solr/kamelets/select"
+ parameters:
+ - name: "q"
+ value: "id:order-1"
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_SOLR_HOST}:${CITRUS_TESTCONTAINERS_SOLR_PORT}"
+ receiveResponse:
+ response:
+ status: 200
+ body:
+ data:
'{"responseHeader":"@ignore@","response":{"numFound":1,"start":0,"numFoundExact":true,"docs":[{"id":"order-1","status_s":"shipped","_version_":"@ignore@","_root_":"order-1"}]}}'
diff --git
a/tests/camel-kamelets-itest/src/test/resources/solr/solr-sink-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/solr/solr-sink-route.yaml
new file mode 100644
index 000000000..35f43b4a0
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/resources/solr/solr-sink-route.yaml
@@ -0,0 +1,43 @@
+# ---------------------------------------------------------------------------
+# 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: "1000"
+ repeatCount: 1
+ steps:
+ - setBody:
+ constant: '{"id":"order-1","status_s":"shipped"}'
+ - to:
+ uri: "kamelet:solr-sink"
+ parameters:
+ servers: '{{solr.host}}:{{solr.port}}'
+ collection: 'kamelets'
+ autocommit: true
+ # 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}"
+ - to:
+ uri: "kamelet:json-serialize-action"
+ - to:
+ uri: "{{http.sink.url}}/result"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/solr/solr-source-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/solr/solr-source-route.citrus.it.yaml
new file mode 100644
index 000000000..fc7aefa16
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/solr/solr-source-route.citrus.it.yaml
@@ -0,0 +1,85 @@
+# ---------------------------------------------------------------------------
+# 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: solr-source-route-test
+actions:
+ # Solr in standalone mode, with the core "kamelets" created at start
+ - testcontainers:
+ start:
+ container:
+ name: "solr"
+ image: "solr:9.10.1-slim"
+ command: "solr-precreate kamelets"
+ startUpTimeout: 180
+ exposedPorts:
+ - 8983
+ waitFor:
+ url: "http://localhost:8983/solr/kamelets/admin/ping"
+
+ # one document that the query matches, and one that it does not
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_SOLR_HOST}:${CITRUS_TESTCONTAINERS_SOLR_PORT}"
+ sendRequest:
+ POST:
+ path: "/solr/kamelets/update"
+ contentType: "application/json"
+ parameters:
+ - name: "commit"
+ value: "true"
+ body:
+ data:
'[{"id":"order-1","status_s":"new"},{"id":"order-2","status_s":"shipped"}]'
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_SOLR_HOST}:${CITRUS_TESTCONTAINERS_SOLR_PORT}"
+ receiveResponse:
+ response:
+ status: 200
+
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "solr/solr-source-route.yaml"
+ systemProperties:
+ properties:
+ - name: "solr.host"
+ value: "${CITRUS_TESTCONTAINERS_SOLR_HOST}"
+ - name: "solr.port"
+ value: "${CITRUS_TESTCONTAINERS_SOLR_PORT}"
+ - name: "http.sink.url"
+ value: "http://localhost:${search.server.port}"
+
+ # the answer of Solr as JSON: the documents found are the list under response
+ - http:
+ server: "searchServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ headers:
+ - name: "X-Body-Type"
+ value: 'org.apache.camel.converter.stream.InputStreamCache'
+ - name: "X-Content-Type"
+ value: 'ct=application/json'
+ body:
+ data:
'{"responseHeader":{"status":0,"QTime":"@ignore@","params":{"q":"status_s:new","wt":"@ignore@"}},"response":[{"id":"order-1","status_s":"new","_version_":"@ignore@","_root_":"order-1"}]}'
+ - http:
+ server: "searchServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/solr/solr-source-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/solr/solr-source-route.yaml
new file mode 100644
index 000000000..d6367d45a
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/resources/solr/solr-source-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: "kamelet:solr-source"
+ parameters:
+ servers: '{{solr.host}}:{{solr.port}}'
+ collection: 'kamelets'
+ query: 'status_s:new'
+ period: 10000
+ 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}"
+ - to:
+ uri: "{{http.sink.url}}/result"