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 655c91d6e chore: Citrus tests for the Kafka Kamelets that had none 
(#3261) (#3265)
655c91d6e is described below

commit 655c91d6e79f573a4df915da4526cf4238f3bc34
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Nov 19 16:00:51 2026 +0100

    chore: Citrus tests for the Kafka Kamelets that had none (#3261) (#3265)
    
    is-tombstone-filter-action, set-kafka-key-action, value-to-key-action and
    message-timestamp-router-action run without a broker. kafka-batch-source 
with
    kafka-batch-manual-commit-action, and kafka-source with
    kafka-manual-commit-action, run against Redpanda. Each test records the body
    type and Content-Type the Kamelet gives, for #3117.
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
---
 .../kafka/kafka-batch-source-route.citrus.it.yaml  | 94 ++++++++++++++++++++++
 .../resources/kafka/kafka-batch-source-route.yaml  | 47 +++++++++++
 ...kafka-manual-commit-action-route.citrus.it.yaml | 80 ++++++++++++++++++
 .../kafka/kafka-manual-commit-action-route.yaml    | 39 +++++++++
 ...is-tombstone-filter-action-route.citrus.it.yaml | 55 +++++++++++++
 .../is-tombstone-filter-action-route.yaml          | 45 +++++++++++
 ...ge-timestamp-router-action-route.citrus.it.yaml | 56 +++++++++++++
 .../message-timestamp-router-action-route.yaml     | 48 +++++++++++
 .../set-kafka-key-action-route.citrus.it.yaml      | 57 +++++++++++++
 .../kafkarouter/set-kafka-key-action-route.yaml    | 44 ++++++++++
 .../value-to-key-action-route.citrus.it.yaml       | 56 +++++++++++++
 .../kafkarouter/value-to-key-action-route.yaml     | 44 ++++++++++
 12 files changed, 665 insertions(+)

diff --git 
a/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-batch-source-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-batch-source-route.citrus.it.yaml
new file mode 100644
index 000000000..50ac57e10
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-batch-source-route.citrus.it.yaml
@@ -0,0 +1,94 @@
+# ---------------------------------------------------------------------------
+# 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: kafka-batch-source-route-test
+variables:
+  - name: "kafka.topic"
+    value: "batch-topic"
+actions:
+  - testcontainers:
+      start:
+        redpanda: {}
+
+  - createEndpoint:
+      name: kafka-batch-source-route-producer
+      type: "kafka"
+      properties:
+        topic: "${kafka.topic}"
+        server: "${CITRUS_TESTCONTAINERS_REDPANDA_BOOTSTRAP_SERVERS}"
+
+  - send:
+      endpoint: kafka-batch-source-route-producer
+      message:
+        body:
+          data: "record-1"
+
+  - send:
+      endpoint: kafka-batch-source-route-producer
+      message:
+        body:
+          data: "record-2"
+
+  - send:
+      endpoint: kafka-batch-source-route-producer
+      message:
+        body:
+          data: "record-3"
+
+  - camel:
+      cli:
+        run:
+          integration:
+            file: "kafka/kafka-batch-source-route.yaml"
+            systemProperties:
+              properties:
+                - name: "kafka.topic"
+                  value: "${kafka.topic}"
+                - name: "kafka.bootstrapServers"
+                  value: "${CITRUS_TESTCONTAINERS_REDPANDA_BOOTSTRAP_SERVERS}"
+                - name: "http.sink.url"
+                  value: "http://localhost:${kafka.sink.server.port}";
+
+  - camel:
+      cli:
+        verify:
+          integration: "kafka-batch-source-route"
+          logMessage: "Subscribed to topic(s): ${kafka.topic}"
+
+  # one message for the three records, as a List of messages
+  - http:
+      server: "kafkaSinkServer"
+      receiveRequest:
+        POST:
+          path: "/result"
+          type: "plaintext"
+          headers:
+            - name: "X-Batch-Size"
+              value: "3"
+            - name: "X-Body-Type"
+              value: "@startsWith('java.util.ImmutableCollections$List')@"
+            - name: "X-Content-Type"
+              value: "ct="
+          body:
+            data: "record-1|record-2|record-3"
+  - http:
+      server: "kafkaSinkServer"
+      sendResponse:
+        response:
+          status: 200
+          reasonPhrase: "OK"
+          version: "HTTP/1.1"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-batch-source-route.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-batch-source-route.yaml
new file mode 100644
index 000000000..b3768b9ab
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-batch-source-route.yaml
@@ -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.
+# ---------------------------------------------------------------------------
+
+- route:
+    from:
+      uri: "kamelet:kafka-batch-source"
+      parameters:
+        bootstrapServers: "{{kafka.bootstrapServers}}"
+        topic: "{{kafka.topic}}"
+        saslAuthType: "NONE"
+        autoOffsetReset: "earliest"
+        consumerGroup: "batch-commit-test"
+        batchSize: 3
+        batchingIntervalMs: 2000
+        allowManualCommit: true
+        autoCommitEnable: 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}"
+        - setHeader:
+            name: X-Batch-Size
+            simple: "${body.size()}"
+        - to:
+            uri: "kamelet:kafka-batch-manual-commit-action"
+        - setBody:
+            simple: 
"${body[0].getMessage().getBody()}|${body[1].getMessage().getBody()}|${body[2].getMessage().getBody()}"
+        - to:
+            uri: "{{http.sink.url}}/result"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-manual-commit-action-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-manual-commit-action-route.citrus.it.yaml
new file mode 100644
index 000000000..704fb8ba6
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-manual-commit-action-route.citrus.it.yaml
@@ -0,0 +1,80 @@
+# ---------------------------------------------------------------------------
+# 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: kafka-manual-commit-action-route-test
+variables:
+  - name: "kafka.topic"
+    value: "commit-topic"
+actions:
+  - testcontainers:
+      start:
+        redpanda: {}
+
+  - camel:
+      cli:
+        run:
+          integration:
+            file: "kafka/kafka-manual-commit-action-route.yaml"
+            systemProperties:
+              properties:
+                - name: "kafka.topic"
+                  value: "${kafka.topic}"
+                - name: "kafka.bootstrapServers"
+                  value: "${CITRUS_TESTCONTAINERS_REDPANDA_BOOTSTRAP_SERVERS}"
+                - name: "http.sink.url"
+                  value: "http://localhost:${kafka.sink.server.port}";
+
+  - camel:
+      cli:
+        verify:
+          integration: "kafka-manual-commit-action-route"
+          logMessage: "Subscribed to topic(s): ${kafka.topic}"
+
+  - createEndpoint:
+      name: kafka-manual-commit-action-route-producer
+      type: "kafka"
+      properties:
+        topic: "${kafka.topic}"
+        server: "${CITRUS_TESTCONTAINERS_REDPANDA_BOOTSTRAP_SERVERS}"
+
+  - send:
+      endpoint: kafka-manual-commit-action-route-producer
+      message:
+        body:
+          data: "record-1"
+
+  # the source sets the commit header, and the action passes the message on 
unchanged
+  - http:
+      server: "kafkaSinkServer"
+      receiveRequest:
+        POST:
+          path: "/result"
+          type: "plaintext"
+          headers:
+            - name: "X-Manual-Commit"
+              value: "@startsWith('KafkaManualCommit[topic=commit-topic')@"
+            - name: "X-Body-Type"
+              value: "java.lang.String"
+          body:
+            data: "record-1"
+  - http:
+      server: "kafkaSinkServer"
+      sendResponse:
+        response:
+          status: 200
+          reasonPhrase: "OK"
+          version: "HTTP/1.1"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-manual-commit-action-route.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-manual-commit-action-route.yaml
new file mode 100644
index 000000000..8e43443e5
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-manual-commit-action-route.yaml
@@ -0,0 +1,39 @@
+# ---------------------------------------------------------------------------
+# 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:kafka-source"
+      parameters:
+        bootstrapServers: "{{kafka.bootstrapServers}}"
+        topic: "{{kafka.topic}}"
+        saslAuthType: "NONE"
+        autoOffsetReset: "earliest"
+        consumerGroup: "manual-commit-test"
+        allowManualCommit: true
+        autoCommitEnable: false
+      steps:
+        - setHeader:
+            name: X-Manual-Commit
+            simple: "${header.CamelKafkaManualCommit}"
+        - to:
+            uri: "kamelet:kafka-manual-commit-action"
+        - setHeader:
+            name: X-Body-Type
+            simple: "${body.getClass().getName()}"
+        - to:
+            uri: "{{http.sink.url}}/result"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/kafkarouter/is-tombstone-filter-action-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/is-tombstone-filter-action-route.citrus.it.yaml
new file mode 100644
index 000000000..22c6a1727
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/is-tombstone-filter-action-route.citrus.it.yaml
@@ -0,0 +1,55 @@
+# ---------------------------------------------------------------------------
+# 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: is-tombstone-filter-action-route-test
+actions:
+  - camel:
+      cli:
+        run:
+          waitForRunningState: false
+          integration:
+            file: "kafkarouter/is-tombstone-filter-action-route.yaml"
+            systemProperties:
+              properties:
+                - name: "http.sink.url"
+                  value: "http://localhost:${http.server.port}";
+                - name: "http.server.port"
+                  value: "${http.server.port}"
+
+  - http:
+      server: "httpServer"
+      receiveRequest:
+        POST:
+          path: "/result"
+          type: "plaintext"
+          headers:
+            - name: "X-Body-Type"
+              value: 'java.lang.String'
+            - name: "X-Content-Type"
+              value: 'ct='
+          body:
+            data: 'ORD-2'
+
+  - http:
+      server: "httpServer"
+      sendResponse:
+        response:
+          status: 200
+          reasonPhrase: "OK"
+          version: "HTTP/1.1"
+          body:
+            data: 'OK'
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/kafkarouter/is-tombstone-filter-action-route.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/is-tombstone-filter-action-route.yaml
new file mode 100644
index 000000000..1c66687c1
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/is-tombstone-filter-action-route.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.
+# ---------------------------------------------------------------------------
+
+- route:
+    from:
+      uri: "timer:tick"
+      parameters:
+        period: "1000"
+        repeatCount: 2
+        includeMetadata: true
+      steps:
+        - choice:
+            when:
+              - simple: "${exchangeProperty.CamelTimerCounter} == 1"
+                steps:
+                  - setBody:
+                      constant: ''
+            otherwise:
+              steps:
+                - setBody:
+                    constant: 'ORD-2'
+        - to:
+            uri: "kamelet:is-tombstone-filter-action"
+        - 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/kafkarouter/message-timestamp-router-action-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/message-timestamp-router-action-route.citrus.it.yaml
new file mode 100644
index 000000000..94905742f
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/message-timestamp-router-action-route.citrus.it.yaml
@@ -0,0 +1,56 @@
+# ---------------------------------------------------------------------------
+# 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: message-timestamp-router-action-route-test
+actions:
+  - camel:
+      cli:
+        run:
+          waitForRunningState: false
+          integration:
+            file: "kafkarouter/message-timestamp-router-action-route.yaml"
+            systemProperties:
+              properties:
+                - name: "http.sink.url"
+                  value: "http://localhost:${http.server.port}";
+                - name: "http.server.port"
+                  value: "${http.server.port}"
+
+  - http:
+      server: "httpServer"
+      receiveRequest:
+        POST:
+          path: "/result"
+          headers:
+            - name: "X-Topic"
+              value: 'orders-20240703'
+            - name: "X-Body-Type"
+              value: 'org.apache.camel.converter.stream.InputStreamCache'
+            - name: "X-Content-Type"
+              value: 'ct=application/json'
+          body:
+            data: '{"id":7,"ts":1720000000000}'
+
+  - http:
+      server: "httpServer"
+      sendResponse:
+        response:
+          status: 200
+          reasonPhrase: "OK"
+          version: "HTTP/1.1"
+          body:
+            data: 'OK'
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/kafkarouter/message-timestamp-router-action-route.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/message-timestamp-router-action-route.yaml
new file mode 100644
index 000000000..a6f08c6e0
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/message-timestamp-router-action-route.yaml
@@ -0,0 +1,48 @@
+# ---------------------------------------------------------------------------
+# 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":7,"ts":1720000000000}'
+        - setHeader:
+            name: Content-Type
+            constant: 'application/json'
+        - setHeader:
+            name: CamelKafkaTopic
+            constant: 'orders'
+        - to:
+            uri: "kamelet:message-timestamp-router-action"
+            parameters:
+              timestampKeys: 'ts'
+              topicFormat: '$[topic]-$[timestamp]'
+        - setHeader:
+            name: X-Body-Type
+            simple: "${body.getClass().getName()}"
+        - setHeader:
+            name: X-Content-Type
+            simple: "ct=${header.Content-Type}"
+        - setHeader:
+            name: X-Topic
+            simple: '${header.CamelKafkaOverrideTopic}'
+        - to:
+            uri: "{{http.sink.url}}/result"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/kafkarouter/set-kafka-key-action-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/set-kafka-key-action-route.citrus.it.yaml
new file mode 100644
index 000000000..2b997a032
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/set-kafka-key-action-route.citrus.it.yaml
@@ -0,0 +1,57 @@
+# ---------------------------------------------------------------------------
+# 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: set-kafka-key-action-route-test
+actions:
+  - camel:
+      cli:
+        run:
+          waitForRunningState: false
+          integration:
+            file: "kafkarouter/set-kafka-key-action-route.yaml"
+            systemProperties:
+              properties:
+                - name: "http.sink.url"
+                  value: "http://localhost:${http.server.port}";
+                - name: "http.server.port"
+                  value: "${http.server.port}"
+
+  - http:
+      server: "httpServer"
+      receiveRequest:
+        POST:
+          path: "/result"
+          type: "plaintext"
+          headers:
+            - name: "X-Kafka-Key"
+              value: 'acme'
+            - name: "X-Body-Type"
+              value: 'java.lang.String'
+            - name: "X-Content-Type"
+              value: 'ct='
+          body:
+            data: 'ORD-1'
+
+  - http:
+      server: "httpServer"
+      sendResponse:
+        response:
+          status: 200
+          reasonPhrase: "OK"
+          version: "HTTP/1.1"
+          body:
+            data: 'OK'
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/kafkarouter/set-kafka-key-action-route.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/set-kafka-key-action-route.yaml
new file mode 100644
index 000000000..85214712a
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/set-kafka-key-action-route.yaml
@@ -0,0 +1,44 @@
+# ---------------------------------------------------------------------------
+# 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: 'ORD-1'
+        - setHeader:
+            name: customer
+            constant: 'acme'
+        - to:
+            uri: "kamelet:set-kafka-key-action"
+            parameters:
+              headerName: 'customer'
+        - setHeader:
+            name: X-Body-Type
+            simple: "${body.getClass().getName()}"
+        - setHeader:
+            name: X-Content-Type
+            simple: "ct=${header.Content-Type}"
+        - setHeader:
+            name: X-Kafka-Key
+            simple: '${header.CamelKafkaKey}'
+        - to:
+            uri: "{{http.sink.url}}/result"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/kafkarouter/value-to-key-action-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/value-to-key-action-route.citrus.it.yaml
new file mode 100644
index 000000000..4ca48532b
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/value-to-key-action-route.citrus.it.yaml
@@ -0,0 +1,56 @@
+# ---------------------------------------------------------------------------
+# 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: value-to-key-action-route-test
+actions:
+  - camel:
+      cli:
+        run:
+          waitForRunningState: false
+          integration:
+            file: "kafkarouter/value-to-key-action-route.yaml"
+            systemProperties:
+              properties:
+                - name: "http.sink.url"
+                  value: "http://localhost:${http.server.port}";
+                - name: "http.server.port"
+                  value: "${http.server.port}"
+
+  - http:
+      server: "httpServer"
+      receiveRequest:
+        POST:
+          path: "/result"
+          headers:
+            - name: "X-Kafka-Key"
+              value: '{id=7}'
+            - name: "X-Body-Type"
+              value: 'org.apache.camel.converter.stream.InputStreamCache'
+            - name: "X-Content-Type"
+              value: 'ct=application/json'
+          body:
+            data: '{"id":7,"customer":"acme","total":12}'
+
+  - http:
+      server: "httpServer"
+      sendResponse:
+        response:
+          status: 200
+          reasonPhrase: "OK"
+          version: "HTTP/1.1"
+          body:
+            data: 'OK'
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/kafkarouter/value-to-key-action-route.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/value-to-key-action-route.yaml
new file mode 100644
index 000000000..df0ed1069
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/value-to-key-action-route.yaml
@@ -0,0 +1,44 @@
+# ---------------------------------------------------------------------------
+# 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":7,"customer":"acme","total":12}'
+        - setHeader:
+            name: Content-Type
+            constant: 'application/json'
+        - to:
+            uri: "kamelet:value-to-key-action"
+            parameters:
+              fields: 'id'
+        - setHeader:
+            name: X-Body-Type
+            simple: "${body.getClass().getName()}"
+        - setHeader:
+            name: X-Content-Type
+            simple: "ct=${header.Content-Type}"
+        - setHeader:
+            name: X-Kafka-Key
+            simple: '${header.CamelKafkaKey}'
+        - to:
+            uri: "{{http.sink.url}}/result"

Reply via email to