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 dc27d177c chore: Citrus tests for the FHIR, Jira, Telegram, IBM COS,
SNMP and Salesforce Kamelets that had none (#3261) (#3277)
dc27d177c is described below
commit dc27d177ca6a731ec5ab0ad9d1b4536b7dd4f252
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Nov 19 19:54:17 2026 +0100
chore: Citrus tests for the FHIR, Jira, Telegram, IBM COS, SNMP and
Salesforce Kamelets that had none (#3261) (#3277)
Adds tests for fhir-source/-sink (HAPI FHIR container), snmp-source (snmpd
container, polled over TCP), ibm-cos-source/-sink (Floci S3 with an
autowired
IBM COS client), and jira-oauth-source, jira-transition-issue-sink,
jira-update-issue-sink, telegram-source/-sink and
salesforce-composite-upsert-sink against the Citrus HTTP server as a
stand-in.
New ServicesIT class; the Jira tests run in JiraIT.
Co-authored-by: Claude Opus 5.5 <[email protected]>
---
.../src/test/java/ServicesIT.java | 94 +++++++++
.../resources/fhir/fhir-sink-route.citrus.it.yaml | 94 +++++++++
.../src/test/resources/fhir/fhir-sink-route.yaml | 50 +++++
.../fhir/fhir-source-route.citrus.it.yaml | 89 +++++++++
.../src/test/resources/fhir/fhir-source-route.yaml | 35 ++++
.../src/test/resources/ibmcos/cos-client.yaml | 33 ++++
.../src/test/resources/ibmcos/getObject.groovy | 31 +++
.../ibmcos/ibm-cos-sink-route.citrus.it.yaml | 90 +++++++++
.../test/resources/ibmcos/ibm-cos-sink-route.yaml | 48 +++++
.../ibmcos/ibm-cos-source-route.citrus.it.yaml | 105 +++++++++++
.../resources/ibmcos/ibm-cos-source-route.yaml | 52 +++++
.../jira/jira-oauth-source-route.citrus.it.yaml | 192 +++++++++++++++++++
.../resources/jira/jira-oauth-source-route.yaml | 37 ++++
...jira-transition-issue-sink-route.citrus.it.yaml | 209 +++++++++++++++++++++
.../jira/jira-transition-issue-sink-route.yaml | 51 +++++
.../jira-update-issue-sink-route.citrus.it.yaml | 142 ++++++++++++++
.../jira/jira-update-issue-sink-route.yaml | 62 ++++++
.../src/test/resources/jira/oauth-key.groovy | 29 +++
...orce-composite-upsert-sink-route.citrus.it.yaml | 126 +++++++++++++
.../salesforce-composite-upsert-sink-route.yaml | 50 +++++
.../snmp/snmp-source-route.citrus.it.yaml | 70 +++++++
.../src/test/resources/snmp/snmp-source-route.yaml | 36 ++++
.../telegram/telegram-sink-route.citrus.it.yaml | 120 ++++++++++++
.../resources/telegram/telegram-sink-route.yaml | 71 +++++++
.../telegram/telegram-source-route.citrus.it.yaml | 101 ++++++++++
.../resources/telegram/telegram-source-route.yaml | 32 ++++
26 files changed, 2049 insertions(+)
diff --git a/tests/camel-kamelets-itest/src/test/java/ServicesIT.java
b/tests/camel-kamelets-itest/src/test/java/ServicesIT.java
new file mode 100644
index 000000000..20770d5a7
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/java/ServicesIT.java
@@ -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.
+ */
+
+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;
+
+/**
+ * Tests of the Kamelets for hosted services: FHIR against a HAPI FHIR server,
SNMP against an snmpd agent and IBM
+ * Cloud Object Storage against the S3 API of Floci, each in a container, and
Telegram and Salesforce against the
+ * Citrus HTTP server, which stands in for the service with canned answers in
the format of its API.
+ */
+@CitrusSupport
+public class ServicesIT {
+
+ private static final String TESTS =
"(fhir|telegram|snmp|salesforce|ibm)-.*";
+
+ private final int servicesServerPort = SocketUtils.findAvailableTcpPort();
+
+ // a container and a first Camel JBang run that downloads the client
libraries take a while
+ @BindToRegistry
+ HttpServer servicesServer = http()
+ .server()
+ .port(servicesServerPort)
+ .timeout(120000L)
+ .autoStart(true)
+ .build();
+
+ @BindToRegistry
+ public SequenceBeforeTest beforeServices() {
+ return new SequenceBeforeTest.Builder().onTests(TESTS).actions(
+ createVariables().variable("services.server.port",
String.valueOf(servicesServerPort))
+ ).build();
+ }
+
+ @BindToRegistry
+ public SequenceAfterTest afterServices() {
+ return new SequenceAfterTest.Builder().onTests(TESTS).actions(
+ purgeEndpoints().endpoint(servicesServer)
+ ).build();
+ }
+
+ @CitrusTestFactory
+ public Stream<DynamicTest> fhir() {
+ return
CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("fhir");
+ }
+
+ @CitrusTestFactory
+ public Stream<DynamicTest> telegram() {
+ return
CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("telegram");
+ }
+
+ @CitrusTestFactory
+ public Stream<DynamicTest> snmp() {
+ return
CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("snmp");
+ }
+
+ @CitrusTestFactory
+ public Stream<DynamicTest> ibmCos() {
+ return
CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("ibmcos");
+ }
+
+ @CitrusTestFactory
+ public Stream<DynamicTest> salesforce() {
+ return
CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("salesforce");
+ }
+}
diff --git
a/tests/camel-kamelets-itest/src/test/resources/fhir/fhir-sink-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/fhir/fhir-sink-route.citrus.it.yaml
new file mode 100644
index 000000000..72bce62ab
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/fhir/fhir-sink-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: fhir-sink-route-test
+variables:
+ - name: "fhir.family"
+ value: "citrus:randomString(10, UPPERCASE)"
+actions:
+ # HAPI FHIR server, R4, with its API under /fhir
+ - testcontainers:
+ start:
+ container:
+ name: "fhir"
+ image: "hapiproject/hapi:v8.12.0-2"
+ startUpTimeout: 300
+ exposedPorts:
+ - 8080
+ env:
+ - name: "hapi.fhir.fhir_version"
+ value: "R4"
+ waitFor:
+ url: "http://localhost:8080/fhir/metadata"
+
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "fhir/fhir-sink-route.yaml"
+ systemProperties:
+ properties:
+ - name: "fhir.url"
+ value:
"http://${CITRUS_TESTCONTAINERS_FHIR_HOST}:${CITRUS_TESTCONTAINERS_FHIR_PORT}/fhir"
+ - name: "fhir.family"
+ value: "${fhir.family}"
+ - name: "http.sink.url"
+ value: "http://localhost:${services.server.port}"
+
+ # the body afterwards is the outcome of the operation, a MethodOutcome of
HAPI FHIR, with the id of the new Patient
+ - http:
+ server: "servicesServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ type: "plaintext"
+ headers:
+ - name: "X-Body-Type"
+ value: 'ca.uhn.fhir.rest.api.MethodOutcome'
+ - name: "X-Content-Type"
+ value: 'ct='
+ - name: "X-Created"
+ value: 'true'
+ - name: "X-Resource-Type"
+ value: 'Patient'
+ body:
+ data: '@variable(fhir.id)@'
+ - http:
+ server: "servicesServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+
+ # the Patient is stored in the FHIR server under that id
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_FHIR_HOST}:${CITRUS_TESTCONTAINERS_FHIR_PORT}"
+ sendRequest:
+ GET:
+ path: "/fhir/Patient/${fhir.id}"
+ headers:
+ - name: "Accept"
+ value: "application/fhir+json"
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_FHIR_HOST}:${CITRUS_TESTCONTAINERS_FHIR_PORT}"
+ receiveResponse:
+ response:
+ status: 200
+ body:
+ data:
'{"resourceType":"Patient","id":"${fhir.id}","meta":"@ignore@","name":[{"family":"${fhir.family}","given":["Grace"]}],"gender":"female"}'
diff --git
a/tests/camel-kamelets-itest/src/test/resources/fhir/fhir-sink-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/fhir/fhir-sink-route.yaml
new file mode 100644
index 000000000..562a4941e
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/resources/fhir/fhir-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:
+ - setBody:
+ constant:
'{"resourceType":"Patient","name":[{"family":"{{fhir.family}}","given":["Grace"]}],"gender":"female"}'
+ - to:
+ uri: "kamelet:fhir-sink"
+ parameters:
+ serverUrl: '{{fhir.url}}'
+ apiName: CREATE
+ methodName: resource
+ # what the Kamelet leaves: the Java type of the body and the
Content-Type
+ - setHeader:
+ name: X-Body-Type
+ simple: "${body.getClass().getName()}"
+ - setHeader:
+ name: X-Content-Type
+ simple: "ct=${header.Content-Type}"
+ # the outcome of the operation: whether it created the resource, and
the id it got
+ - setHeader:
+ name: X-Created
+ simple: "${body.getCreated()}"
+ - setHeader:
+ name: X-Resource-Type
+ simple: "${body.getId().getResourceType()}"
+ - setBody:
+ simple: "${body.getId().getIdPart()}"
+ - to:
+ uri: "{{http.sink.url}}/result"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/fhir/fhir-source-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/fhir/fhir-source-route.citrus.it.yaml
new file mode 100644
index 000000000..ef6cea270
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/fhir/fhir-source-route.citrus.it.yaml
@@ -0,0 +1,89 @@
+# ---------------------------------------------------------------------------
+# 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: fhir-source-route-test
+variables:
+ - name: "fhir.family"
+ value: "citrus:randomString(10, UPPERCASE)"
+actions:
+ # HAPI FHIR server, R4, with its API under /fhir
+ - testcontainers:
+ start:
+ container:
+ name: "fhir"
+ image: "hapiproject/hapi:v8.12.0-2"
+ startUpTimeout: 300
+ exposedPorts:
+ - 8080
+ env:
+ - name: "hapi.fhir.fhir_version"
+ value: "R4"
+ waitFor:
+ url: "http://localhost:8080/fhir/metadata"
+
+ # one Patient that the search finds
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_FHIR_HOST}:${CITRUS_TESTCONTAINERS_FHIR_PORT}"
+ sendRequest:
+ POST:
+ path: "/fhir/Patient"
+ contentType: "application/fhir+json"
+ body:
+ data:
'{"resourceType":"Patient","name":[{"family":"${fhir.family}","given":["Ada"]}],"gender":"female"}'
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_FHIR_HOST}:${CITRUS_TESTCONTAINERS_FHIR_PORT}"
+ receiveResponse:
+ response:
+ status: 201
+ body:
+ data:
'{"resourceType":"Patient","id":"@variable(fhir.id)@","meta":"@ignore@","name":"@ignore@","gender":"female"}'
+
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "fhir/fhir-source-route.yaml"
+ systemProperties:
+ properties:
+ - name: "fhir.url"
+ value:
"http://${CITRUS_TESTCONTAINERS_FHIR_HOST}:${CITRUS_TESTCONTAINERS_FHIR_PORT}/fhir"
+ - name: "fhir.family"
+ value: "${fhir.family}"
+ - name: "http.sink.url"
+ value: "http://localhost:${services.server.port}"
+
+ # the search result: a Bundle of type searchset as JSON text (in a stream),
with the Patient under entry
+ - http:
+ server: "servicesServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ headers:
+ - name: "X-Body-Type"
+ value: 'org.apache.camel.converter.stream.InputStreamCache'
+ - name: "X-Content-Type"
+ value: 'ct=application/fhir+json'
+ body:
+ data:
'{"resourceType":"Bundle","id":"@ignore@","meta":{"lastUpdated":"@ignore@"},"type":"searchset","total":1,"link":[{"relation":"self","url":"@endsWith(''/fhir/Patient?_format=json&family=${fhir.family}'')@"}],"entry":[{"fullUrl":"@endsWith(''/fhir/Patient/${fhir.id}'')@","resource":{"resourceType":"Patient","id":"${fhir.id}","meta":{"versionId":"1","lastUpdated":"@ignore@"},"name":[{"family":"${fhir.family}","given":["Ada"]}],"gender":"female"},"search":{"mode":"match"}}]}'
+ - http:
+ server: "servicesServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/fhir/fhir-source-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/fhir/fhir-source-route.yaml
new file mode 100644
index 000000000..ef0b7fe2c
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/resources/fhir/fhir-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:fhir-source"
+ parameters:
+ serverUrl: '{{fhir.url}}'
+ url: '/Patient?family={{fhir.family}}'
+ prettyPrint: false
+ delay: 60000
+ 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"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/ibmcos/cos-client.yaml
b/tests/camel-kamelets-itest/src/test/resources/ibmcos/cos-client.yaml
new file mode 100644
index 000000000..5769fdea5
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/resources/ibmcos/cos-client.yaml
@@ -0,0 +1,33 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+# The IBM COS client for the Kamelet, against the S3 API of the Floci
container. IBM Cloud Object Storage
+# logs in with an API key through IBM Cloud IAM, at an address that cannot be
changed, so the test gives the
+# component a client of its own with HMAC credentials instead: the cosClient
option of the component is
+# autowired, and then the apiKey and endpointUrl options of the Kamelet are
not used.
+- beans:
+ - name: cosClient
+ type: "com.ibm.cloud.objectstorage.services.s3.AmazonS3"
+ scriptLanguage: groovy
+ script: |
+
com.ibm.cloud.objectstorage.services.s3.AmazonS3ClientBuilder.standard()
+ .withCredentials(new
com.ibm.cloud.objectstorage.auth.AWSStaticCredentialsProvider(
+ new
com.ibm.cloud.objectstorage.auth.BasicAWSCredentials('{{s3.access.key}}',
'{{s3.secret.key}}')))
+ .withPathStyleAccessEnabled(true)
+ .withEndpointConfiguration(new
com.ibm.cloud.objectstorage.client.builder.AwsClientBuilder.EndpointConfiguration(
+ '{{s3.url}}', '{{s3.region}}'))
+ .build()
diff --git
a/tests/camel-kamelets-itest/src/test/resources/ibmcos/getObject.groovy
b/tests/camel-kamelets-itest/src/test/resources/ibmcos/getObject.groovy
new file mode 100644
index 000000000..b1d82743d
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/resources/ibmcos/getObject.groovy
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Reads the file that ibm-cos-sink uploaded, with the S3 client of the Floci
container, and checks its content.
+
+import software.amazon.awssdk.services.s3.S3Client
+import software.amazon.awssdk.services.s3.model.GetObjectRequest
+
+S3Client s3 = context.getReferenceResolver().resolve('ibmCosSinkS3Client',
S3Client.class)
+
+def response = s3.getObjectAsBytes(GetObjectRequest.builder()
+ .bucket(context.getVariable('s3.bucket'))
+ .key('reports/2026-11-19.csv')
+ .build())
+
+String content = response.asUtf8String()
+assert content == 'ORD-1,42' : "Expected the uploaded file but got '" +
content + "'"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/ibmcos/ibm-cos-sink-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/ibmcos/ibm-cos-sink-route.citrus.it.yaml
new file mode 100644
index 000000000..c6d7e1b21
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/ibmcos/ibm-cos-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: ibm-cos-sink-route-test
+description: 'ibm-cos-sink uploads the body as a file named by the file
header, and leaves the ETag in the CamelIBMCOSETag header'
+variables:
+ - name: "s3.bucket"
+ value: "ibm-cos-sink"
+actions:
+ # an S3 API (Floci) in place of IBM Cloud Object Storage, with the bucket
+ - testcontainers:
+ start:
+ localstack:
+ services:
+ - "S3"
+ options:
+ buckets: '${s3.bucket}'
+ s3ClientName: "ibmCosSinkS3Client"
+ - waitFor:
+ http:
+ url: "${CITRUS_TESTCONTAINERS_LOCALSTACK_SERVICE_URL}"
+
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ args:
+ - "--dep=camel:groovy"
+ - "--dep=camel:ibm-cos"
+ resources:
+ - "cos-client.yaml"
+ integration:
+ file: "ibmcos/ibm-cos-sink-route.yaml"
+ systemProperties:
+ properties:
+ - name: "s3.bucket"
+ value: "${s3.bucket}"
+ - name: "s3.url"
+ value: "${CITRUS_TESTCONTAINERS_LOCALSTACK_SERVICE_URL}"
+ - name: "s3.access.key"
+ value: "${CITRUS_TESTCONTAINERS_LOCALSTACK_ACCESS_KEY}"
+ - name: "s3.secret.key"
+ value: "${CITRUS_TESTCONTAINERS_LOCALSTACK_SECRET_KEY}"
+ - name: "s3.region"
+ value: "${CITRUS_TESTCONTAINERS_LOCALSTACK_REGION}"
+ - name: "http.sink.url"
+ value: "http://localhost:${services.server.port}"
+
+ # the message is unchanged, with the ETag of the uploaded file
+ - http:
+ server: "servicesServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ type: "plaintext"
+ headers:
+ - name: "X-Body-Type"
+ value: 'java.lang.String'
+ - name: "X-Content-Type"
+ value: 'ct='
+ - name: "X-ETag"
+ value: '@notEmpty()@'
+ body:
+ data: 'ORD-1,42'
+ - http:
+ server: "servicesServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+
+ # the file is in the bucket under the name of the file header
+ - groovy:
+ script:
+ file: "ibmcos/getObject.groovy"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/ibmcos/ibm-cos-sink-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/ibmcos/ibm-cos-sink-route.yaml
new file mode 100644
index 000000000..59c386c8d
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/ibmcos/ibm-cos-sink-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: 'ORD-1,42'
+ - setHeader:
+ name: file
+ constant: 'reports/2026-11-19.csv'
+ - to:
+ uri: "kamelet:ibm-cos-sink"
+ parameters:
+ bucketName: '{{s3.bucket}}'
+ apiKey: 'not-used'
+ serviceInstanceId:
'crn:v1:bluemix:public:cloud-object-storage:global:a/0:0::'
+ endpointUrl: '{{s3.url}}'
+ # what the Kamelet leaves: the Java type of the body and the
Content-Type
+ - setHeader:
+ name: X-Body-Type
+ simple: "${body.getClass().getName()}"
+ - setHeader:
+ name: X-Content-Type
+ simple: "ct=${header.Content-Type}"
+ - setHeader:
+ name: X-ETag
+ simple: "${header.CamelIBMCOSETag}"
+ - to:
+ uri: "{{http.sink.url}}/result"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/ibmcos/ibm-cos-source-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/ibmcos/ibm-cos-source-route.citrus.it.yaml
new file mode 100644
index 000000000..65a21c3fb
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/ibmcos/ibm-cos-source-route.citrus.it.yaml
@@ -0,0 +1,105 @@
+# ---------------------------------------------------------------------------
+# 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: ibm-cos-source-route-test
+description: 'ibm-cos-source reads each file of the bucket, with the bucket,
key, content type, size and ETag as headers, and deletes it'
+variables:
+ - name: "s3.bucket"
+ value: "ibm-cos-source"
+actions:
+ # an S3 API (Floci) in place of IBM Cloud Object Storage, with the bucket
+ - testcontainers:
+ start:
+ localstack:
+ services:
+ - "S3"
+ options:
+ buckets: '${s3.bucket}'
+ s3ClientName: "ibmCosSourceS3Client"
+ - waitFor:
+ http:
+ url: "${CITRUS_TESTCONTAINERS_LOCALSTACK_SERVICE_URL}"
+
+ # one file in the bucket
+ - send:
+ endpoint:
camel:aws2-s3://${s3.bucket}?amazonS3Client=#ibmCosSourceS3Client
+ message:
+ headers:
+ - name: CamelAwsS3Key
+ value: "inbox/orders.csv"
+ - name: CamelAwsS3ContentType
+ value: "text/csv"
+ body:
+ data: "ORD-1,42"
+
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ args:
+ - "--dep=camel:groovy"
+ - "--dep=camel:ibm-cos"
+ resources:
+ - "cos-client.yaml"
+ integration:
+ file: "ibmcos/ibm-cos-source-route.yaml"
+ systemProperties:
+ properties:
+ - name: "s3.bucket"
+ value: "${s3.bucket}"
+ - name: "s3.url"
+ value: "${CITRUS_TESTCONTAINERS_LOCALSTACK_SERVICE_URL}"
+ - name: "s3.access.key"
+ value: "${CITRUS_TESTCONTAINERS_LOCALSTACK_ACCESS_KEY}"
+ - name: "s3.secret.key"
+ value: "${CITRUS_TESTCONTAINERS_LOCALSTACK_SECRET_KEY}"
+ - name: "s3.region"
+ value: "${CITRUS_TESTCONTAINERS_LOCALSTACK_REGION}"
+ - name: "http.sink.url"
+ value: "http://localhost:${services.server.port}"
+
+ # the content of the file, with the headers that describe it
+ - http:
+ server: "servicesServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ type: "plaintext"
+ headers:
+ - name: "X-Body-Type"
+ value: 'org.apache.camel.converter.stream.InputStreamCache'
+ - name: "X-Content-Type"
+ value: 'ct='
+ - name: "X-Bucket"
+ value: '${s3.bucket}'
+ - name: "X-Key"
+ value: 'inbox/orders.csv'
+ - name: "X-Object-Content-Type"
+ value: 'ct=text/csv'
+ - name: "X-Object-Length"
+ value: '8'
+ - name: "X-ETag"
+ value: '@notEmpty()@'
+ body:
+ data: 'ORD-1,42'
+ - http:
+ server: "servicesServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/ibmcos/ibm-cos-source-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/ibmcos/ibm-cos-source-route.yaml
new file mode 100644
index 000000000..e49708ec9
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/ibmcos/ibm-cos-source-route.yaml
@@ -0,0 +1,52 @@
+# ---------------------------------------------------------------------------
+# 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:ibm-cos-source"
+ parameters:
+ bucketName: '{{s3.bucket}}'
+ apiKey: 'not-used'
+ serviceInstanceId:
'crn:v1:bluemix:public:cloud-object-storage:global:a/0:0::'
+ endpointUrl: '{{s3.url}}'
+ delay: 2000
+ steps:
+ # what the Kamelet gives: the Java type of the body and the
Content-Type
+ - setHeader:
+ name: X-Body-Type
+ simple: "${body.getClass().getName()}"
+ - setHeader:
+ name: X-Content-Type
+ simple: "ct=${header.Content-Type}"
+ # the documented headers, which are not sent over HTTP as they start
with Camel
+ - setHeader:
+ name: X-Bucket
+ simple: "${header.CamelIBMCOSBucketName}"
+ - setHeader:
+ name: X-Key
+ simple: "${header.CamelIBMCOSKey}"
+ - setHeader:
+ name: X-Object-Content-Type
+ simple: "ct=${header.CamelIBMCOSContentType}"
+ - setHeader:
+ name: X-Object-Length
+ simple: "${header.CamelIBMCOSContentLength}"
+ - setHeader:
+ name: X-ETag
+ simple: "${header.CamelIBMCOSETag}"
+ - to:
+ uri: "{{http.sink.url}}/result"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/jira/jira-oauth-source-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/jira/jira-oauth-source-route.citrus.it.yaml
new file mode 100644
index 000000000..3604fd5c7
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/jira/jira-oauth-source-route.citrus.it.yaml
@@ -0,0 +1,192 @@
+# ---------------------------------------------------------------------------
+# 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: jira-oauth-source-route-test
+description: 'jira-oauth-source signs each request to Jira with OAuth 1.0a and
gives each new issue as JSON text'
+variables:
+ - name: "jira.project.id"
+ value: "10001"
+ - name: "jira.issue.id"
+ value: "10002"
+ - name: "jira.issue.key"
+ value: "CAMEL-2"
+ - name: "jira.issue.summary"
+ value: "New bug, citrus:randomString(10)"
+ - name: "jira.access.token"
+ value: "citrus:randomString(32)"
+ - name: "jira.verification.code"
+ value: "citrus:randomString(6)"
+ - name: "jira.consumer.key"
+ value: "kamelets-it"
+ - name: "jira.jql"
+ value: "project=CAMEL"
+actions:
+ - createVariables:
+ variables:
+ - name: "jira.url"
+ value: "http://localhost:${jira.server.port}"
+ # an RSA private key for the OAuth signature, generated for the test
+ - groovy:
+ script:
+ file: "jira/oauth-key.groovy"
+
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "jira/jira-oauth-source-route.yaml"
+ systemProperties:
+ properties:
+ - name: "jira.url"
+ value: "${jira.url}"
+ - name: "jira.access.token"
+ value: "${jira.access.token}"
+ - name: "jira.verification.code"
+ value: "${jira.verification.code}"
+ - name: "jira.consumer.key"
+ value: "${jira.consumer.key}"
+ - name: "jira.private.key"
+ value: "${jira.private.key}"
+ - name: "jira.jql"
+ value: "${jira.jql}"
+
+ # the Jira client first reads the user it logs in as, with the request
signed with OAuth 1.0a (RSA-SHA1)
+ - http:
+ server: "jiraServer"
+ receiveRequest:
+ GET:
+ path: "/rest/api/latest/myself"
+ headers:
+ - name: Authorization
+ value: "@matches('OAuth .*')@"
+ - http:
+ server: "jiraServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+ contentType: "application/json"
+ body:
+ data:
'{"name":"citrus","emailAddress":"[email protected]","displayName":"Citrus
User","timeZone":"UTC","avatarUrls":{"48x48":"${jira.url}/secure/useravatar?avatarId=10342"}}'
+
+ # the first poll asks for the latest issue, to send only the issues created
after the start; there is none yet
+ - http:
+ server: "jiraServer"
+ receiveRequest:
+ GET:
+ path: "/rest/api/latest/search"
+ headers:
+ - name: Authorization
+ value: "@matches('OAuth .*')@"
+ - http:
+ server: "jiraServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+ contentType: "application/json"
+ body:
+ data:
'{"expand":"","startAt":0,"maxResults":1,"total":0,"issues":[]}'
+
+ # the next poll finds one new issue
+ - http:
+ server: "jiraServer"
+ receiveRequest:
+ GET:
+ path: "/rest/api/latest/search"
+ parameters:
+ - name: jql
+ value: "citrus:urlEncode(${jira.jql})"
+ headers:
+ - name: Authorization
+ value: "@matches('OAuth .*')@"
+ - http:
+ server: "jiraServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+ contentType: "application/json"
+ body:
+ data: |
+ {
+ "expand": "schema,names",
+ "startAt": 0,
+ "maxResults": 50,
+ "total": 1,
+ "names": {},
+ "schema": {},
+ "issues": [
+ {
+ "expand": "",
+ "id": "${jira.issue.id}",
+ "key": "${jira.issue.key}",
+ "self":
"${jira.url}/rest/api/latest/issue/${jira.issue.id}",
+ "fields": {
+ "project": {
+ "self":
"${jira.url}/rest/api/latest/project/${jira.project.id}",
+ "id": "${jira.project.id}",
+ "key": "CAMEL",
+ "name": "Camel"
+ },
+ "summary": "${jira.issue.summary}",
+ "issuetype": {
+ "self": "${jira.url}/rest/api/latest/issuetype/1",
+ "id": "1",
+ "description": "A problem with the software.",
+ "iconUrl": "${jira.url}/images/icons/bug.gif",
+ "name": "Bug",
+ "subtask": false
+ },
+ "created": "2026-11-19T10:15:30.000+0000",
+ "updated": "2026-11-19T10:15:30.000+0000",
+ "status": {
+ "self": "${jira.url}/rest/api/latest/status/1",
+ "id": 1,
+ "description": "Open task.",
+ "iconUrl": "${jira.url}/images/icons/status_1.gif",
+ "name": "Open"
+ }
+ }
+ }
+ ]
+ }
+
+ # the issue as JSON text (in a stream), as the Jira client reads it
+ - http:
+ server: "jiraServer"
+ 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:
'{"affectedVersions":null,"assignee":null,"attachments":null,"attachmentsUri":"${jira.url}/rest/api/latest/issue/${jira.issue.id}/attachments","changelog":null,"comments":[],"commentsUri":"${jira.url}/rest/api/latest/issue/${jira.issue.id}/comment","components":null,"creationDate":"2026-11-19T10:15:30.000Z","description":null,"dueDate":null,"expandos":[""],"fields":[],"fixVersions":null,"id":${jira.issue.id},"issueLinks":null,"issueType":{"description":"A
problem with t [...]
+ - http:
+ server: "jiraServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/jira/jira-oauth-source-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/jira/jira-oauth-source-route.yaml
new file mode 100644
index 000000000..c06a11453
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/jira/jira-oauth-source-route.yaml
@@ -0,0 +1,37 @@
+# ---------------------------------------------------------------------------
+# 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:jira-oauth-source"
+ parameters:
+ jiraUrl: '{{jira.url}}'
+ accessToken: '{{jira.access.token}}'
+ verificationCode: '{{jira.verification.code}}'
+ consumerKey: '{{jira.consumer.key}}'
+ privateKey: '{{jira.private.key}}'
+ jql: '{{jira.jql}}'
+ 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: "{{jira.url}}/result"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/jira/jira-transition-issue-sink-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/jira/jira-transition-issue-sink-route.citrus.it.yaml
new file mode 100644
index 000000000..f8a534ff1
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/jira/jira-transition-issue-sink-route.citrus.it.yaml
@@ -0,0 +1,209 @@
+# ---------------------------------------------------------------------------
+# 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: jira-transition-issue-sink-route-test
+description: 'jira-transition-issue-sink runs the transition of the
ce-issueTransitionId header on the issue of ce-issueKey, then adds the body as
a comment'
+variables:
+ - name: "jira.project.id"
+ value: "10001"
+ - name: "jira.issue.id"
+ value: "10003"
+ - name: "jira.issue.key"
+ value: "CAMEL-3"
+ - name: "jira.issue.summary"
+ value: "Fix the build"
+ - name: "jira.issue.comment"
+ value: "Fixed in build 42"
+ - name: "jira.transition.id"
+ value: "31"
+ - name: "jira.username"
+ value: "citrus"
+ - name: "jira.password"
+ value: "secr3t"
+actions:
+ - createVariables:
+ variables:
+ - name: "jira.url"
+ value: "http://localhost:${jira.server.port}"
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "jira/jira-transition-issue-sink-route.yaml"
+ systemProperties:
+ properties:
+ - name: "jira.url"
+ value: "${jira.url}"
+ - name: "jira.issue.key"
+ value: "${jira.issue.key}"
+ - name: "jira.issue.comment"
+ value: "${jira.issue.comment}"
+ - name: "jira.transition.id"
+ value: "${jira.transition.id}"
+ - name: "jira.username"
+ value: "${jira.username}"
+ - name: "jira.password"
+ value: "${jira.password}"
+
+ # the Jira client first reads the issue
+ - http:
+ server: "jiraServer"
+ receiveRequest:
+ GET:
+ path: "/rest/api/latest/issue/${jira.issue.key}"
+ headers:
+ - name: Authorization
+ value: "Basic
citrus:encodeBase64(${jira.username}:${jira.password})"
+ - http:
+ server: "jiraServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+ contentType: "application/json"
+ body:
+ data: |
+ {
+ "expand": "schema,names",
+ "id": "${jira.issue.id}",
+ "key": "${jira.issue.key}",
+ "self": "${jira.url}/rest/api/latest/issue/${jira.issue.id}",
+ "names": {},
+ "schema": {},
+ "fields": {
+ "project": {
+ "self":
"${jira.url}/rest/api/latest/project/${jira.project.id}",
+ "id": "${jira.project.id}",
+ "key": "CAMEL"
+ },
+ "summary": "${jira.issue.summary}",
+ "issuetype": {
+ "self": "${jira.url}/rest/api/latest/issuetype/3",
+ "id": "3",
+ "description": "A task that needs to be done.",
+ "iconUrl": "${jira.url}/images/icons/task.gif",
+ "name": "Task",
+ "subtask": false
+ },
+ "created": "2026-11-19T10:15:30.000+0000",
+ "updated": "2026-11-19T10:15:30.000+0000",
+ "status": {
+ "self": "${jira.url}/rest/api/latest/status/3",
+ "id": 3,
+ "description": "Work on it has begun.",
+ "iconUrl": "${jira.url}/images/icons/status_3.gif",
+ "name": "In Progress"
+ }
+ }
+ }
+
+ # and the version of Jira
+ - http:
+ server: "jiraServer"
+ receiveRequest:
+ GET:
+ path: "/rest/api/latest/serverInfo"
+ - http:
+ server: "jiraServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+ contentType: "application/json"
+ body:
+ data:
'{"baseUrl":"${jira.url}","version":"9.12.0","versionNumbers":[9,12,0],"buildNumber":9120000,"buildDate":"2026-01-01T00:00:00.000+0000","serverTime":"2026-11-19T10:15:30.000+0000","scmInfo":"abc","serverTitle":"Test
Jira Server"}'
+
+ # the transition of the ce-issueTransitionId header, not of the
CamelJiraIssueTransitionId header set before the Kamelet
+ - http:
+ server: "jiraServer"
+ receiveRequest:
+ POST:
+ path: "/rest/api/latest/issue/${jira.issue.id}/transitions"
+ headers:
+ - name: Authorization
+ value: "Basic
citrus:encodeBase64(${jira.username}:${jira.password})"
+ body:
+ data: '{"transition":{"id":${jira.transition.id}}}'
+ - http:
+ server: "jiraServer"
+ sendResponse:
+ response:
+ status: 204
+ reasonPhrase: "No Content"
+ version: "HTTP/1.1"
+
+ # then the body as a comment
+ - http:
+ server: "jiraServer"
+ receiveRequest:
+ POST:
+ path: "/rest/api/latest/issue/${jira.issue.id}/comment"
+ headers:
+ - name: Authorization
+ value: "Basic
citrus:encodeBase64(${jira.username}:${jira.password})"
+ body:
+ data: '{"body":"${jira.issue.comment}"}'
+ - http:
+ server: "jiraServer"
+ sendResponse:
+ response:
+ status: 201
+ reasonPhrase: "Created"
+ version: "HTTP/1.1"
+ contentType: "application/json"
+ body:
+ data: |
+ {
+ "self":
"${jira.url}/rest/api/latest/issue/${jira.issue.id}/comment/10100",
+ "id": "10100",
+ "author": {
+ "self": "${jira.url}/rest/api/latest/user?username=citrus",
+ "name": "citrus",
+ "displayName": "Citrus User",
+ "active": true
+ },
+ "body": "${jira.issue.comment}",
+ "created": "2026-11-19T10:15:31.000+0000",
+ "updated": "2026-11-19T10:15:31.000+0000"
+ }
+
+ # the message is unchanged
+ - http:
+ server: "jiraServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ type: "plaintext"
+ headers:
+ - name: "X-Body-Type"
+ value: 'java.lang.String'
+ - name: "X-Content-Type"
+ value: 'ct='
+ - name: "ce-issueKey"
+ value: '${jira.issue.key}'
+ body:
+ data: '${jira.issue.comment}'
+ - http:
+ server: "jiraServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/jira/jira-transition-issue-sink-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/jira/jira-transition-issue-sink-route.yaml
new file mode 100644
index 000000000..360e852ff
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/jira/jira-transition-issue-sink-route.yaml
@@ -0,0 +1,51 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+- route:
+ from:
+ uri: "timer:tick"
+ parameters:
+ period: "1000"
+ repeatCount: 1
+ steps:
+ - setBody:
+ constant: '{{jira.issue.comment}}'
+ - setHeader:
+ name: ce-issueKey
+ constant: '{{jira.issue.key}}'
+ - setHeader:
+ name: ce-issueTransitionId
+ constant: '{{jira.transition.id}}'
+ # a header that must not reach the Jira component: the Kamelet removes
it first
+ - setHeader:
+ name: CamelJiraIssueTransitionId
+ constant: '999'
+ - to:
+ uri: "kamelet:jira-transition-issue-sink"
+ parameters:
+ jiraUrl: '{{jira.url}}'
+ username: '{{jira.username}}'
+ password: '{{jira.password}}'
+ # what the Kamelet leaves: the Java type of the body and the
Content-Type
+ - setHeader:
+ name: X-Body-Type
+ simple: "${body.getClass().getName()}"
+ - setHeader:
+ name: X-Content-Type
+ simple: "ct=${header.Content-Type}"
+ - to:
+ uri: "{{jira.url}}/result"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/jira/jira-update-issue-sink-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/jira/jira-update-issue-sink-route.citrus.it.yaml
new file mode 100644
index 000000000..16d1c333f
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/jira/jira-update-issue-sink-route.citrus.it.yaml
@@ -0,0 +1,142 @@
+# ---------------------------------------------------------------------------
+# 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: jira-update-issue-sink-route-test
+description: 'jira-update-issue-sink sets the fields of the ce-issue headers
on the issue of ce-issueKey, with the body as the description, and logs in with
a personal access token'
+variables:
+ - name: "jira.issue.key"
+ value: "CAMEL-4"
+ - name: "jira.issue.summary"
+ value: "The build fails on Java 25"
+ - name: "jira.issue.description"
+ value: "The build fails with an error in the compiler plugin."
+ - name: "jira.personal.token"
+ value: "citrus:randomString(24)"
+actions:
+ - createVariables:
+ variables:
+ - name: "jira.url"
+ value: "http://localhost:${jira.server.port}"
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "jira/jira-update-issue-sink-route.yaml"
+ systemProperties:
+ properties:
+ - name: "jira.url"
+ value: "${jira.url}"
+ - name: "jira.issue.key"
+ value: "${jira.issue.key}"
+ - name: "jira.issue.summary"
+ value: "${jira.issue.summary}"
+ - name: "jira.issue.description"
+ value: "${jira.issue.description}"
+ - name: "jira.personal.token"
+ value: "${jira.personal.token}"
+
+ # the issue type is looked up by its name
+ - http:
+ server: "jiraServer"
+ receiveRequest:
+ GET:
+ path: "/rest/api/latest/issuetype"
+ headers:
+ - name: Authorization
+ value: "Bearer ${jira.personal.token}"
+ - http:
+ server: "jiraServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+ contentType: "application/json"
+ body:
+ data: |
+ [
+ {"self": "${jira.url}/rest/api/latest/issuetype/1", "id": "1",
"description": "A problem.", "iconUrl": "${jira.url}/images/icons/bug.png",
"name": "Bug", "subtask": false},
+ {"self": "${jira.url}/rest/api/latest/issuetype/3", "id": "3",
"description": "A task.", "iconUrl": "${jira.url}/images/icons/task.png",
"name": "Task", "subtask": false}
+ ]
+
+ # and so is the priority
+ - http:
+ server: "jiraServer"
+ receiveRequest:
+ GET:
+ path: "/rest/api/latest/priority"
+ headers:
+ - name: Authorization
+ value: "Bearer ${jira.personal.token}"
+ - http:
+ server: "jiraServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+ contentType: "application/json"
+ body:
+ data: |
+ [
+ {"self": "${jira.url}/rest/api/latest/priority/2", "id": "2",
"statusColor": "#ff0000", "description": "Serious.", "iconUrl":
"${jira.url}/images/icons/high.png", "name": "High"},
+ {"self": "${jira.url}/rest/api/latest/priority/3", "id": "3",
"statusColor": "#ffff00", "description": "Normal.", "iconUrl":
"${jira.url}/images/icons/medium.png", "name": "Medium"}
+ ]
+
+ # the update of the issue, with the body as the description
+ - http:
+ server: "jiraServer"
+ receiveRequest:
+ PUT:
+ path: "/rest/api/latest/issue/${jira.issue.key}"
+ headers:
+ - name: Authorization
+ value: "Bearer ${jira.personal.token}"
+ body:
+ data:
'{"fields":{"issuetype":{"id":"1"},"summary":"${jira.issue.summary}","description":"${jira.issue.description}","components":[{"name":"core"},{"name":"yaml-dsl"}],"priority":{"id":"2"},"assignee":{"name":"superman"}},"properties":[]}'
+ - http:
+ server: "jiraServer"
+ sendResponse:
+ response:
+ status: 204
+ reasonPhrase: "No Content"
+ version: "HTTP/1.1"
+
+ # the message is unchanged
+ - http:
+ server: "jiraServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ type: "plaintext"
+ headers:
+ - name: "X-Body-Type"
+ value: 'java.lang.String'
+ - name: "X-Content-Type"
+ value: 'ct='
+ - name: "ce-issueKey"
+ value: '${jira.issue.key}'
+ body:
+ data: '${jira.issue.description}'
+ - http:
+ server: "jiraServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/jira/jira-update-issue-sink-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/jira/jira-update-issue-sink-route.yaml
new file mode 100644
index 000000000..48e5cb4a8
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/jira/jira-update-issue-sink-route.yaml
@@ -0,0 +1,62 @@
+# ---------------------------------------------------------------------------
+# 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: '{{jira.issue.description}}'
+ - setHeader:
+ name: ce-issueKey
+ constant: '{{jira.issue.key}}'
+ - setHeader:
+ name: ce-issueSummary
+ constant: '{{jira.issue.summary}}'
+ - setHeader:
+ name: ce-issueTypeName
+ constant: 'Bug'
+ - setHeader:
+ name: ce-issuePriorityName
+ constant: 'High'
+ - setHeader:
+ name: ce-issueAssignee
+ constant: 'superman'
+ - setHeader:
+ name: ce-issueComponents
+ constant: 'core, yaml-dsl'
+ # a header that must not reach the Jira component: the Kamelet removes
it first, so the type is looked up by name
+ - setHeader:
+ name: CamelJiraIssueTypeId
+ constant: '999'
+ - to:
+ uri: "kamelet:jira-update-issue-sink"
+ parameters:
+ jiraUrl: '{{jira.url}}'
+ personal-token: '{{jira.personal.token}}'
+ # what the Kamelet leaves: the Java type of the body and the
Content-Type
+ - setHeader:
+ name: X-Body-Type
+ simple: "${body.getClass().getName()}"
+ - setHeader:
+ name: X-Content-Type
+ simple: "ct=${header.Content-Type}"
+ - to:
+ uri: "{{jira.url}}/result"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/jira/oauth-key.groovy
b/tests/camel-kamelets-itest/src/test/resources/jira/oauth-key.groovy
new file mode 100644
index 000000000..af76e8c2e
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/resources/jira/oauth-key.groovy
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Generates an RSA key pair for the OAuth 1.0a login of jira-oauth-source, so
that no private key is kept
+// in the repository. The private key goes to the Kamelet, in PKCS8 format and
Base64 encoded on one line,
+// as its privateKey option asks for.
+//
+// - jira.private.key: the private key, for the Kamelet
+
+import java.security.KeyPairGenerator
+
+def generator = KeyPairGenerator.getInstance('RSA')
+generator.initialize(2048)
+def keyPair = generator.generateKeyPair()
+context.setVariable('jira.private.key',
Base64.getEncoder().encodeToString(keyPair.getPrivate().getEncoded()))
diff --git
a/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-composite-upsert-sink-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-composite-upsert-sink-route.citrus.it.yaml
new file mode 100644
index 000000000..4897cd1d2
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-composite-upsert-sink-route.citrus.it.yaml
@@ -0,0 +1,126 @@
+# ---------------------------------------------------------------------------
+# 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: salesforce-composite-upsert-sink-route-test
+description: 'salesforce-composite-upsert-sink logs in, then sends the records
of the body in one composite upsert call, matched by the external ID field'
+variables:
+ - name: "salesforce.client.id"
+ value: "citrus:randomString(20)"
+ - name: "salesforce.client.secret"
+ value: "citrus:randomString(20)"
+ - name: "salesforce.username"
+ value: "[email protected]"
+ - name: "salesforce.password"
+ value: "secr3t"
+ - name: "salesforce.token"
+ value: "00Dcitrus:randomString(20)"
+actions:
+ - createVariables:
+ variables:
+ - name: "salesforce.url"
+ value: "http://localhost:${services.server.port}"
+ # the Citrus HTTP server stands in for Salesforce, both for the login
(loginUrl) and for the org (instance_url)
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ # camel-salesforce gets protobuf-java 3.x through grpc-protobuf, but
its Pub/Sub classes need 4.x,
+ # without which the component does not start in Camel JBang
+ args:
+ - "--dep=com.google.protobuf:protobuf-java:4.35.1"
+ integration:
+ file: "salesforce/salesforce-composite-upsert-sink-route.yaml"
+ systemProperties:
+ properties:
+ - name: "salesforce.url"
+ value: "${salesforce.url}"
+ - name: "salesforce.client.id"
+ value: "${salesforce.client.id}"
+ - name: "salesforce.client.secret"
+ value: "${salesforce.client.secret}"
+ - name: "salesforce.username"
+ value: "${salesforce.username}"
+ - name: "salesforce.password"
+ value: "${salesforce.password}"
+ - name: "http.sink.url"
+ value: "http://localhost:${services.server.port}"
+
+ # the OAuth login with the username and password flow
+ - http:
+ server: "servicesServer"
+ receiveRequest:
+ POST:
+ path: "/services/oauth2/token"
+ type: "plaintext"
+ body:
+ data:
'password=${salesforce.password}&grant_type=password&format=json&client_secret=${salesforce.client.secret}&client_id=${salesforce.client.id}&username=citrus%40example.com'
+ - http:
+ server: "servicesServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+ contentType: "application/json"
+ body:
+ data:
'{"access_token":"${salesforce.token}","instance_url":"${salesforce.url}","id":"${salesforce.url}/id/00D000000000001AAA/005000000000001AAA","token_type":"Bearer","issued_at":"1763550000000","signature":"c2lnbmF0dXJl"}'
+
+ # the records in one call, matched by the external ID field
+ - http:
+ server: "servicesServer"
+ receiveRequest:
+ PATCH:
+ path:
"/services/data/v56.0/composite/sobjects/Contact/External_Id__c"
+ headers:
+ - name: Authorization
+ value: "Bearer ${salesforce.token}"
+ body:
+ data:
'{"allOrNone":false,"records":[{"attributes":{"type":"Contact"},"External_Id__c":"C-1","LastName":"Lovelace"},{"attributes":{"type":"Contact"},"External_Id__c":"C-2","FirstName":"Grace"}]}'
+ - http:
+ server: "servicesServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+ contentType: "application/json"
+ body:
+ data:
'[{"id":"003000000000001AAA","success":true,"errors":[],"created":true},{"id":null,"success":false,"errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Required
fields are missing: [LastName]","fields":["LastName"]}],"created":false}]'
+
+ # the body afterwards: a List with one result per record, in the same order
(sent here as its text)
+ - http:
+ server: "servicesServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ type: "plaintext"
+ headers:
+ - name: "X-Body-Type"
+ value: 'java.util.ArrayList'
+ - name: "X-Result-Type"
+ value:
'org.apache.camel.component.salesforce.api.dto.UpsertSObjectResult'
+ - name: "X-Content-Type"
+ value: 'ct='
+ body:
+ data:
'[{"id":"003000000000001AAA","errors":[],"success":true,"created":true},
{"id":null,"errors":[{"errorCode":"REQUIRED_FIELD_MISSING","message":"Required
fields are missing:
[LastName]","fields":["LastName"]}],"success":false,"created":false}]'
+ - http:
+ server: "servicesServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-composite-upsert-sink-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-composite-upsert-sink-route.yaml
new file mode 100644
index 000000000..6cd336cae
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-composite-upsert-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:
+ - setBody:
+ constant:
'{"records":[{"attributes":{"type":"Contact"},"External_Id__c":"C-1","LastName":"Lovelace"},{"attributes":{"type":"Contact"},"External_Id__c":"C-2","FirstName":"Grace"}]}'
+ - to:
+ uri: "kamelet:salesforce-composite-upsert-sink"
+ parameters:
+ sObjectName: Contact
+ sObjectIdName: External_Id__c
+ loginUrl: '{{salesforce.url}}'
+ clientId: '{{salesforce.client.id}}'
+ clientSecret: '{{salesforce.client.secret}}'
+ userName: '{{salesforce.username}}'
+ password: '{{salesforce.password}}'
+ # what the Kamelet leaves: the Java type of the body and the
Content-Type
+ - setHeader:
+ name: X-Body-Type
+ simple: "${body.getClass().getName()}"
+ - setHeader:
+ name: X-Content-Type
+ simple: "ct=${header.Content-Type}"
+ - setHeader:
+ name: X-Result-Type
+ simple: "${body[0].getClass().getName()}"
+ - setBody:
+ simple: "${bodyAs(String)}"
+ - to:
+ uri: "{{http.sink.url}}/result"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/snmp/snmp-source-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/snmp/snmp-source-route.citrus.it.yaml
new file mode 100644
index 000000000..efffb63b2
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/snmp/snmp-source-route.citrus.it.yaml
@@ -0,0 +1,70 @@
+# ---------------------------------------------------------------------------
+# 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: snmp-source-route-test
+description: 'snmp-source polls the OIDs of the oids option from an SNMP agent
and gives their values as XML text'
+actions:
+ # an SNMP agent (Net-SNMP snmpd) that answers SNMP v1 and v2c with the
community public, here over TCP,
+ # as Testcontainers maps TCP ports only
+ - testcontainers:
+ start:
+ container:
+ name: "snmp"
+ image: "polinux/snmpd:latest"
+ command: "-Lo tcp:161 udp:161"
+ startUpTimeout: 120
+ exposedPorts:
+ - 161
+ waitFor:
+ logMessage: '.*NET-SNMP version.*'
+
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "snmp/snmp-source-route.yaml"
+ systemProperties:
+ properties:
+ - name: "snmp.host"
+ value: "${CITRUS_TESTCONTAINERS_SNMP_HOST}"
+ - name: "snmp.port"
+ value: "${CITRUS_TESTCONTAINERS_SNMP_PORT}"
+ - name: "http.sink.url"
+ value: "http://localhost:${services.server.port}"
+
+ # the values of sysLocation and sysContact, as the snmpd.conf of the image
sets them, one entry per OID
+ - http:
+ server: "servicesServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ type: "plaintext"
+ headers:
+ - name: "X-Body-Type"
+ value: 'java.lang.String'
+ - name: "X-Content-Type"
+ value: 'ct='
+ body:
+ data: '<snmp><entry><oid>1.3.6.1.2.1.1.6.0</oid><value>Unknown
(edit
/etc/snmp/snmpd.conf)</value></entry><entry><oid>1.3.6.1.2.1.1.4.0</oid><value>Root
<root@localhost> (configure
/etc/snmp/snmp.local.conf)</value></entry></snmp>'
+ - http:
+ server: "servicesServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/snmp/snmp-source-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/snmp/snmp-source-route.yaml
new file mode 100644
index 000000000..916bc1541
--- /dev/null
+++ b/tests/camel-kamelets-itest/src/test/resources/snmp/snmp-source-route.yaml
@@ -0,0 +1,36 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+- route:
+ from:
+ uri: "kamelet:snmp-source"
+ parameters:
+ host: '{{snmp.host}}'
+ port: '{{snmp.port}}'
+ protocol: tcp
+ oids: '1.3.6.1.2.1.1.6.0,1.3.6.1.2.1.1.4.0'
+ delay: 60000
+ 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"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/telegram/telegram-sink-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/telegram/telegram-sink-route.citrus.it.yaml
new file mode 100644
index 000000000..83ef8da5b
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/telegram/telegram-sink-route.citrus.it.yaml
@@ -0,0 +1,120 @@
+# ---------------------------------------------------------------------------
+# 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: telegram-sink-route-test
+description: 'telegram-sink sends the body as a text message, or as a photo by
its Content-Type, to the chat of the chat-id header or the chatId option'
+variables:
+ - name: "telegram.token"
+ value: "123456789:citrus:randomString(35)"
+actions:
+ # the Citrus HTTP server stands in for the Telegram Bot API, through the
baseUri option of the component
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "telegram/telegram-sink-route.yaml"
+ systemProperties:
+ properties:
+ - name: "telegram.token"
+ value: "${telegram.token}"
+ - name: "camel.component.telegram.baseUri"
+ value: "http://localhost:${services.server.port}"
+ - name: "http.sink.url"
+ value: "http://localhost:${services.server.port}"
+
+ # the text message goes to the chat of the chatId option, not of the
CamelTelegramChatId header
+ - http:
+ server: "servicesServer"
+ receiveRequest:
+ POST:
+ path: "/bot${telegram.token}/sendMessage"
+ body:
+ data: '{"chat_id":"-100123","text":"Order ORD-1 has shipped"}'
+ - http:
+ server: "servicesServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+ contentType: "application/json"
+ body:
+ data:
'{"ok":true,"result":{"message_id":8,"from":{"id":333,"is_bot":true,"first_name":"Kamelets","username":"kamelets_bot"},"chat":{"id":-100123,"title":"Orders","type":"group"},"date":1763550000,"text":"Order
ORD-1 has shipped"}}'
+
+ # the body afterwards is the answer of Telegram as JSON text, as the
Telegram component reads it: the message
+ # sent, under message
+ - http:
+ server: "servicesServer"
+ 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:
'{"description":null,"error_code":null,"message":{"audio":null,"caption":null,"caption_entities":null,"chat":{"all_members_are_administrators":false,"id":"-100123","title":"Orders","type":"group"},"date":1763550000,"document":null,"entities":null,"from":{"added_to_attachment_menu":null,"bot":true,"can_connect_to_business":null,"can_join_groups":null,"can_read_all_group_messages":null,"first_name":"Kamelets","has_main_web_app":null,"has_topics_enabled":null,"id":333,"is_
[...]
+ - http:
+ server: "servicesServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+
+ # the photo goes to the chat of the chat-id header, as a multipart form with
the caption
+ - http:
+ server: "servicesServer"
+ receiveRequest:
+ POST:
+ path: "/bot${telegram.token}/sendPhoto"
+ type: "plaintext"
+ body:
+ data: "@contains('PNG image bytes')@"
+ - http:
+ server: "servicesServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+ contentType: "application/json"
+ body:
+ data:
'{"ok":true,"result":{"message_id":9,"from":{"id":333,"is_bot":true,"first_name":"Kamelets","username":"kamelets_bot"},"chat":{"id":4711,"first_name":"Ada","type":"private"},"date":1763550001,"photo":[{"file_id":"AgAD","file_unique_id":"AQAD","file_size":15,"width":1,"height":1}],"caption":"The
parcel"}}'
+
+ # the answer of Telegram as JSON text; the Content-Type is now
application/json, no longer image/png
+ - http:
+ server: "servicesServer"
+ 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:
'{"description":null,"error_code":null,"message":{"audio":null,"caption":"The
parcel","caption_entities":null,"chat":{"all_members_are_administrators":false,"id":"4711","title":null,"type":"private"},"date":1763550001,"document":null,"entities":null,"from":{"added_to_attachment_menu":null,"bot":true,"can_connect_to_business":null,"can_join_groups":null,"can_read_all_group_messages":null,"first_name":"Kamelets","has_main_web_app":null,"has_topics_enabled":null,"id":333,"
[...]
+ - http:
+ server: "servicesServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/telegram/telegram-sink-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/telegram/telegram-sink-route.yaml
new file mode 100644
index 000000000..4b81acac3
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/telegram/telegram-sink-route.yaml
@@ -0,0 +1,71 @@
+# ---------------------------------------------------------------------------
+# 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:
+ # a text message to the chat of the chatId option; the
CamelTelegramChatId header is removed by the Kamelet
+ - setBody:
+ constant: 'Order ORD-1 has shipped'
+ - setHeader:
+ name: CamelTelegramChatId
+ constant: '999'
+ - to:
+ uri: "kamelet:telegram-sink"
+ parameters:
+ authorizationToken: '{{telegram.token}}'
+ chatId: '-100123'
+ # what the Kamelet leaves: the Java type of the body and the
Content-Type
+ - setHeader:
+ name: X-Body-Type
+ simple: "${body.getClass().getName()}"
+ - setHeader:
+ name: X-Content-Type
+ simple: "ct=${header.Content-Type}"
+ - to:
+ uri: "{{http.sink.url}}/result"
+ # a photo, by its Content-Type, to the chat of the chat-id header,
with the text header as its caption
+ - removeHeaders:
+ pattern: "X-*"
+ - setBody:
+ constant: 'PNG image bytes'
+ - setHeader:
+ name: Content-Type
+ constant: 'image/png'
+ - setHeader:
+ name: chat-id
+ constant: '4711'
+ - setHeader:
+ name: text
+ constant: 'The parcel'
+ - to:
+ uri: "kamelet:telegram-sink"
+ parameters:
+ authorizationToken: '{{telegram.token}}'
+ chatId: '-100123'
+ - 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/telegram/telegram-source-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/telegram/telegram-source-route.citrus.it.yaml
new file mode 100644
index 000000000..deb45ee27
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/telegram/telegram-source-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: telegram-source-route-test
+description: 'telegram-source asks the Bot API for updates and gives each
message as JSON text, with the chat in the chat-id and ce-chatid headers'
+variables:
+ - name: "telegram.token"
+ value: "123456789:citrus:randomString(35)"
+actions:
+ # the Citrus HTTP server stands in for the Telegram Bot API, through the
baseUri option of the component
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "telegram/telegram-source-route.yaml"
+ systemProperties:
+ properties:
+ - name: "telegram.token"
+ value: "${telegram.token}"
+ - name: "camel.component.telegram.baseUri"
+ value: "http://localhost:${services.server.port}"
+ - name: "http.sink.url"
+ value: "http://localhost:${services.server.port}"
+
+ # the first poll, with no offset yet, gets one message from a private chat
+ - http:
+ server: "servicesServer"
+ receiveRequest:
+ GET:
+ path: "/bot${telegram.token}/getUpdates"
+ - http:
+ server: "servicesServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+ contentType: "application/json"
+ body:
+ data:
'{"ok":true,"result":[{"update_id":100,"message":{"message_id":7,"from":{"id":4711,"is_bot":false,"first_name":"Ada","username":"ada"},"chat":{"id":4711,"first_name":"Ada","type":"private"},"date":1763550000,"text":"Hello
bot"}}]}'
+
+ # the message as JSON text, as the Telegram component reads it (with all its
fields, also the empty ones),
+ # with the chat in the headers
+ - http:
+ server: "servicesServer"
+ 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: "chat-id"
+ value: '4711'
+ - name: "ce-chatid"
+ value: '4711'
+ body:
+ data:
'{"audio":null,"caption":null,"caption_entities":null,"chat":{"all_members_are_administrators":false,"id":"4711","title":null,"type":"private"},"date":1763550000,"document":null,"entities":null,"from":{"added_to_attachment_menu":null,"bot":false,"can_connect_to_business":null,"can_join_groups":null,"can_read_all_group_messages":null,"first_name":"Ada","has_main_web_app":null,"has_topics_enabled":null,"id":4711,"is_bot":false,"is_premium":null,"language_code":null,"last_
[...]
+ - http:
+ server: "servicesServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+
+ # the next poll asks only for the updates after that one, so each message is
received once
+ - http:
+ server: "servicesServer"
+ receiveRequest:
+ GET:
+ path: "/bot${telegram.token}/getUpdates"
+ parameters:
+ - name: "offset"
+ value: "101"
+ - http:
+ server: "servicesServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+ contentType: "application/json"
+ body:
+ data: '{"ok":true,"result":[]}'
diff --git
a/tests/camel-kamelets-itest/src/test/resources/telegram/telegram-source-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/telegram/telegram-source-route.yaml
new file mode 100644
index 000000000..59b046fd6
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/telegram/telegram-source-route.yaml
@@ -0,0 +1,32 @@
+# ---------------------------------------------------------------------------
+# 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:telegram-source"
+ parameters:
+ authorizationToken: '{{telegram.token}}'
+ 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"