This is an automated email from the ASF dual-hosted git repository. oscerd pushed a commit to branch chore/tier1-citrus-tests in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
commit 0f6146f09e1cf69198feb47beffefea5fdf18a7c Author: Andrea Cosentino <[email protected]> AuthorDate: Thu Jul 9 18:54:44 2026 +0200 chore: Add Citrus integration tests for 10 self-contained kamelets Add Citrus integration tests for kamelets that require no external services or containers, using the existing CommonIT HTTP mock and log verification infrastructure: - cron-source (log-verify: emits scheduled message) - set-body-action (http-mock: replaces body) - delay-action (http-mock: message passes through after delay) - throttle-action (http-mock: message flows through rate limiter) - simple-filter-action (http-mock: non-matching message passes) - xj-identity-action (http-mock: JSON-to-XML transform) - dns-ip-action (log-verify: localhost resolves to 127.0.0.1) - regex-router-action (log-verify: Kafka topic regex replacement) - timestamp-router-action (log-verify: topic gets timestamp prefix) - topic-name-matches-filter-action (log-verify: matching topic passes) All tests use Camel route YAML format per issue #2873. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Signed-off-by: Andrea Cosentino <[email protected]> --- .../src/test/java/CommonIT.java | 35 +++++++++++++++++ .../cron/cron-source-route.citrus.it.yaml | 30 +++++++++++++++ .../src/test/resources/cron/cron-source-route.yaml | 28 ++++++++++++++ .../delay/delay-action-route.citrus.it.yaml | 44 ++++++++++++++++++++++ .../test/resources/delay/delay-action-route.yaml | 34 +++++++++++++++++ .../dns/dns-ip-action-route.citrus.it.yaml | 30 +++++++++++++++ .../test/resources/dns/dns-ip-action-route.yaml | 30 +++++++++++++++ .../simple-filter-action-route.citrus.it.yaml | 44 ++++++++++++++++++++++ .../filter/simple-filter-action-route.yaml | 34 +++++++++++++++++ .../regex-router-action-route.citrus.it.yaml | 30 +++++++++++++++ .../kafkarouter/regex-router-action-route.yaml | 38 +++++++++++++++++++ .../timestamp-router-action-route.citrus.it.yaml | 30 +++++++++++++++ .../kafkarouter/timestamp-router-action-route.yaml | 41 ++++++++++++++++++++ ...name-matches-filter-action-route.citrus.it.yaml | 30 +++++++++++++++ .../topic-name-matches-filter-action-route.yaml | 35 +++++++++++++++++ .../setbody/set-body-action-route.citrus.it.yaml | 44 ++++++++++++++++++++++ .../resources/setbody/set-body-action-route.yaml | 34 +++++++++++++++++ .../throttle/throttle-action-route.citrus.it.yaml | 44 ++++++++++++++++++++++ .../resources/throttle/throttle-action-route.yaml | 34 +++++++++++++++++ .../xj/xj-identity-action-route.citrus.it.yaml | 42 +++++++++++++++++++++ .../resources/xj/xj-identity-action-route.yaml | 38 +++++++++++++++++++ 21 files changed, 749 insertions(+) diff --git a/tests/camel-kamelets-itest/src/test/java/CommonIT.java b/tests/camel-kamelets-itest/src/test/java/CommonIT.java index 6c3351084..d3f35ae19 100644 --- a/tests/camel-kamelets-itest/src/test/java/CommonIT.java +++ b/tests/camel-kamelets-itest/src/test/java/CommonIT.java @@ -103,4 +103,39 @@ public class CommonIT { public Stream<DynamicTest> counter() { return CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("counter"); } + + @CitrusTestFactory + public Stream<DynamicTest> cron() { + return CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("cron"); + } + + @CitrusTestFactory + public Stream<DynamicTest> setBody() { + return CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("setbody"); + } + + @CitrusTestFactory + public Stream<DynamicTest> delay() { + return CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("delay"); + } + + @CitrusTestFactory + public Stream<DynamicTest> throttle() { + return CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("throttle"); + } + + @CitrusTestFactory + public Stream<DynamicTest> xj() { + return CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("xj"); + } + + @CitrusTestFactory + public Stream<DynamicTest> dns() { + return CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("dns"); + } + + @CitrusTestFactory + public Stream<DynamicTest> kafkaRouter() { + return CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("kafkarouter"); + } } diff --git a/tests/camel-kamelets-itest/src/test/resources/cron/cron-source-route.citrus.it.yaml b/tests/camel-kamelets-itest/src/test/resources/cron/cron-source-route.citrus.it.yaml new file mode 100644 index 000000000..5a5ba0319 --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/cron/cron-source-route.citrus.it.yaml @@ -0,0 +1,30 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +name: cron-source-route-test +actions: + - camel: + jbang: + run: + waitForRunningState: false + integration: + file: "cron/cron-source-route.yaml" + - camel: + jbang: + verify: + integration: "cron-source-route" + logMessage: "cron-test-12345" diff --git a/tests/camel-kamelets-itest/src/test/resources/cron/cron-source-route.yaml b/tests/camel-kamelets-itest/src/test/resources/cron/cron-source-route.yaml new file mode 100644 index 000000000..482d9b2b6 --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/cron/cron-source-route.yaml @@ -0,0 +1,28 @@ +# --------------------------------------------------------------------------- +# 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:cron-source" + parameters: + schedule: "0/1 * * * * ?" + message: "cron-test-12345" + steps: + - to: + uri: "kamelet:log-sink" + parameters: + showHeaders: true diff --git a/tests/camel-kamelets-itest/src/test/resources/delay/delay-action-route.citrus.it.yaml b/tests/camel-kamelets-itest/src/test/resources/delay/delay-action-route.citrus.it.yaml new file mode 100644 index 000000000..fc08e20b2 --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/delay/delay-action-route.citrus.it.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. +# --------------------------------------------------------------------------- + +name: delay-action-route-test +variables: + - name: "test.message" + value: "delayed-message-test" +actions: + - camel: + jbang: + run: + integration: + file: "delay/delay-action-route.yaml" + systemProperties: + properties: + - name: "test.message" + value: "${test.message}" + - name: "http.sink.url" + value: "http://localhost:${http.server.port}" + - http: + server: "httpServer" + receiveRequest: + POST: + path: "/result" + body: + data: "${test.message}" + - http: + server: "httpServer" + sendResponse: + status: 200 diff --git a/tests/camel-kamelets-itest/src/test/resources/delay/delay-action-route.yaml b/tests/camel-kamelets-itest/src/test/resources/delay/delay-action-route.yaml new file mode 100644 index 000000000..4b5a6e6bb --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/delay/delay-action-route.yaml @@ -0,0 +1,34 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +- route: + from: + uri: "timer:tick" + parameters: + period: "10000" + repeatCount: 1 + steps: + - setBody: + constant: "{{test.message}}" + - to: + uri: "kamelet:delay-action" + parameters: + milliseconds: 100 + - to: + uri: "kamelet:http-sink" + parameters: + url: "{{http.sink.url}}/result" diff --git a/tests/camel-kamelets-itest/src/test/resources/dns/dns-ip-action-route.citrus.it.yaml b/tests/camel-kamelets-itest/src/test/resources/dns/dns-ip-action-route.citrus.it.yaml new file mode 100644 index 000000000..efc034888 --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/dns/dns-ip-action-route.citrus.it.yaml @@ -0,0 +1,30 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +name: dns-ip-action-route-test +actions: + - camel: + jbang: + run: + waitForRunningState: false + integration: + file: "dns/dns-ip-action-route.yaml" + - camel: + jbang: + verify: + integration: "dns-ip-action-route" + logMessage: "127.0.0.1" diff --git a/tests/camel-kamelets-itest/src/test/resources/dns/dns-ip-action-route.yaml b/tests/camel-kamelets-itest/src/test/resources/dns/dns-ip-action-route.yaml new file mode 100644 index 000000000..4ecb16f39 --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/dns/dns-ip-action-route.yaml @@ -0,0 +1,30 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +- route: + from: + uri: "timer:tick" + parameters: + period: "10000" + repeatCount: 1 + steps: + - setBody: + constant: "localhost" + - to: + uri: "kamelet:dns-ip-action" + - to: + uri: "kamelet:log-sink" diff --git a/tests/camel-kamelets-itest/src/test/resources/filter/simple-filter-action-route.citrus.it.yaml b/tests/camel-kamelets-itest/src/test/resources/filter/simple-filter-action-route.citrus.it.yaml new file mode 100644 index 000000000..c8e01d945 --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/filter/simple-filter-action-route.citrus.it.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. +# --------------------------------------------------------------------------- + +name: simple-filter-action-route-test +variables: + - name: "test.message" + value: "passthrough-message" +actions: + - camel: + jbang: + run: + integration: + file: "filter/simple-filter-action-route.yaml" + systemProperties: + properties: + - name: "test.message" + value: "${test.message}" + - name: "http.sink.url" + value: "http://localhost:${http.server.port}" + - http: + server: "httpServer" + receiveRequest: + POST: + path: "/result" + body: + data: "${test.message}" + - http: + server: "httpServer" + sendResponse: + status: 200 diff --git a/tests/camel-kamelets-itest/src/test/resources/filter/simple-filter-action-route.yaml b/tests/camel-kamelets-itest/src/test/resources/filter/simple-filter-action-route.yaml new file mode 100644 index 000000000..dc29c726b --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/filter/simple-filter-action-route.yaml @@ -0,0 +1,34 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +- route: + from: + uri: "timer:tick" + parameters: + period: "10000" + repeatCount: 1 + steps: + - setBody: + constant: "{{test.message}}" + - to: + uri: "kamelet:simple-filter-action" + parameters: + expression: "${body} == 'DROP_ME'" + - to: + uri: "kamelet:http-sink" + parameters: + url: "{{http.sink.url}}/result" diff --git a/tests/camel-kamelets-itest/src/test/resources/kafkarouter/regex-router-action-route.citrus.it.yaml b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/regex-router-action-route.citrus.it.yaml new file mode 100644 index 000000000..3e3841936 --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/regex-router-action-route.citrus.it.yaml @@ -0,0 +1,30 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +name: regex-router-action-route-test +actions: + - camel: + jbang: + run: + waitForRunningState: false + integration: + file: "kafkarouter/regex-router-action-route.yaml" + - camel: + jbang: + verify: + integration: "regex-router-action-route" + logMessage: "prefix-my-topic" diff --git a/tests/camel-kamelets-itest/src/test/resources/kafkarouter/regex-router-action-route.yaml b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/regex-router-action-route.yaml new file mode 100644 index 000000000..059d1b121 --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/regex-router-action-route.yaml @@ -0,0 +1,38 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +- route: + from: + uri: "timer:tick" + parameters: + period: "10000" + repeatCount: 1 + steps: + - setBody: + constant: "test-data" + - setHeader: + name: CamelKafkaTopic + constant: "my-topic" + - to: + uri: "kamelet:regex-router-action" + parameters: + regex: "(.*)" + replacement: "prefix-$1" + - to: + uri: "kamelet:log-sink" + parameters: + showHeaders: true diff --git a/tests/camel-kamelets-itest/src/test/resources/kafkarouter/timestamp-router-action-route.citrus.it.yaml b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/timestamp-router-action-route.citrus.it.yaml new file mode 100644 index 000000000..8eaf1493e --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/timestamp-router-action-route.citrus.it.yaml @@ -0,0 +1,30 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +name: timestamp-router-action-route-test +actions: + - camel: + jbang: + run: + waitForRunningState: false + integration: + file: "kafkarouter/timestamp-router-action-route.yaml" + - camel: + jbang: + verify: + integration: "timestamp-router-action-route" + logMessage: "my-topic-20240703" diff --git a/tests/camel-kamelets-itest/src/test/resources/kafkarouter/timestamp-router-action-route.yaml b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/timestamp-router-action-route.yaml new file mode 100644 index 000000000..9a78e8e7a --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/timestamp-router-action-route.yaml @@ -0,0 +1,41 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +- route: + from: + uri: "timer:tick" + parameters: + period: "10000" + repeatCount: 1 + steps: + - setBody: + constant: "test-data" + - setHeader: + name: CamelKafkaTopic + constant: "my-topic" + - setHeader: + name: CamelKafkaTimestamp + constant: "1720000000000" + - to: + uri: "kamelet:timestamp-router-action" + parameters: + topicFormat: "$[topic]-$[timestamp]" + timestampFormat: "yyyyMMdd" + - to: + uri: "kamelet:log-sink" + parameters: + showHeaders: true diff --git a/tests/camel-kamelets-itest/src/test/resources/kafkarouter/topic-name-matches-filter-action-route.citrus.it.yaml b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/topic-name-matches-filter-action-route.citrus.it.yaml new file mode 100644 index 000000000..e7a34f111 --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/topic-name-matches-filter-action-route.citrus.it.yaml @@ -0,0 +1,30 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +name: topic-name-matches-filter-action-route-test +actions: + - camel: + jbang: + run: + waitForRunningState: false + integration: + file: "kafkarouter/topic-name-matches-filter-action-route.yaml" + - camel: + jbang: + verify: + integration: "topic-name-matches-filter-action-route" + logMessage: "topic-filter-test-data" diff --git a/tests/camel-kamelets-itest/src/test/resources/kafkarouter/topic-name-matches-filter-action-route.yaml b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/topic-name-matches-filter-action-route.yaml new file mode 100644 index 000000000..2049740a0 --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/kafkarouter/topic-name-matches-filter-action-route.yaml @@ -0,0 +1,35 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +- route: + from: + uri: "timer:tick" + parameters: + period: "10000" + repeatCount: 1 + steps: + - setBody: + constant: "topic-filter-test-data" + - setHeader: + name: CamelKafkaTopic + constant: "orders-topic" + - to: + uri: "kamelet:topic-name-matches-filter-action" + parameters: + regex: "orders.*" + - to: + uri: "kamelet:log-sink" diff --git a/tests/camel-kamelets-itest/src/test/resources/setbody/set-body-action-route.citrus.it.yaml b/tests/camel-kamelets-itest/src/test/resources/setbody/set-body-action-route.citrus.it.yaml new file mode 100644 index 000000000..3275805dd --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/setbody/set-body-action-route.citrus.it.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. +# --------------------------------------------------------------------------- + +name: set-body-action-route-test +variables: + - name: "set.body.value" + value: "Replaced body content" +actions: + - camel: + jbang: + run: + integration: + file: "setbody/set-body-action-route.yaml" + systemProperties: + properties: + - name: "set.body.value" + value: "${set.body.value}" + - name: "http.sink.url" + value: "http://localhost:${http.server.port}" + - http: + server: "httpServer" + receiveRequest: + POST: + path: "/result" + body: + data: "${set.body.value}" + - http: + server: "httpServer" + sendResponse: + status: 200 diff --git a/tests/camel-kamelets-itest/src/test/resources/setbody/set-body-action-route.yaml b/tests/camel-kamelets-itest/src/test/resources/setbody/set-body-action-route.yaml new file mode 100644 index 000000000..ff7ceb18c --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/setbody/set-body-action-route.yaml @@ -0,0 +1,34 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +- route: + from: + uri: "timer:tick" + parameters: + period: "10000" + repeatCount: 1 + steps: + - setBody: + constant: "original-body" + - to: + uri: "kamelet:set-body-action" + parameters: + value: "{{set.body.value}}" + - to: + uri: "kamelet:http-sink" + parameters: + url: "{{http.sink.url}}/result" diff --git a/tests/camel-kamelets-itest/src/test/resources/throttle/throttle-action-route.citrus.it.yaml b/tests/camel-kamelets-itest/src/test/resources/throttle/throttle-action-route.citrus.it.yaml new file mode 100644 index 000000000..ebbd1db7a --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/throttle/throttle-action-route.citrus.it.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. +# --------------------------------------------------------------------------- + +name: throttle-action-route-test +variables: + - name: "test.message" + value: "throttled-message-test" +actions: + - camel: + jbang: + run: + integration: + file: "throttle/throttle-action-route.yaml" + systemProperties: + properties: + - name: "test.message" + value: "${test.message}" + - name: "http.sink.url" + value: "http://localhost:${http.server.port}" + - http: + server: "httpServer" + receiveRequest: + POST: + path: "/result" + body: + data: "${test.message}" + - http: + server: "httpServer" + sendResponse: + status: 200 diff --git a/tests/camel-kamelets-itest/src/test/resources/throttle/throttle-action-route.yaml b/tests/camel-kamelets-itest/src/test/resources/throttle/throttle-action-route.yaml new file mode 100644 index 000000000..bb4eb2c85 --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/throttle/throttle-action-route.yaml @@ -0,0 +1,34 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +- route: + from: + uri: "timer:tick" + parameters: + period: "10000" + repeatCount: 1 + steps: + - setBody: + constant: "{{test.message}}" + - to: + uri: "kamelet:throttle-action" + parameters: + messages: 5 + - to: + uri: "kamelet:http-sink" + parameters: + url: "{{http.sink.url}}/result" diff --git a/tests/camel-kamelets-itest/src/test/resources/xj/xj-identity-action-route.citrus.it.yaml b/tests/camel-kamelets-itest/src/test/resources/xj/xj-identity-action-route.citrus.it.yaml new file mode 100644 index 000000000..61d8468ca --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/xj/xj-identity-action-route.citrus.it.yaml @@ -0,0 +1,42 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +name: xj-identity-action-route-test +actions: + - camel: + jbang: + run: + integration: + file: "xj/xj-identity-action-route.yaml" + systemProperties: + properties: + - name: "http.sink.url" + value: "http://localhost:${http.server.port}" + - http: + server: "httpServer" + receiveRequest: + POST: + path: "/result" + - http: + server: "httpServer" + sendResponse: + status: 200 + - camel: + jbang: + verify: + integration: "xj-identity-action-route" + logMessage: "name" diff --git a/tests/camel-kamelets-itest/src/test/resources/xj/xj-identity-action-route.yaml b/tests/camel-kamelets-itest/src/test/resources/xj/xj-identity-action-route.yaml new file mode 100644 index 000000000..ca0ccf4be --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/xj/xj-identity-action-route.yaml @@ -0,0 +1,38 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +- route: + from: + uri: "timer:tick" + parameters: + period: "10000" + repeatCount: 1 + steps: + - setBody: + constant: '{"name":"test","value":"hello"}' + - to: + uri: "kamelet:xj-identity-action" + parameters: + direction: "JSON2XML" + - to: + uri: "kamelet:log-sink" + parameters: + showHeaders: true + - to: + uri: "kamelet:http-sink" + parameters: + url: "{{http.sink.url}}/result"
