From b25737b2f3fac3cc8263becd77a7699d41ff2085 Mon Sep 17 00:00:00 2001 From: Christoph Deppisch Date: Fri, 8 Dec 2023 20:56:16 +0100 Subject: [PATCH] chore: Introduce Maven module for YAKS tests - Manage YAKS version in Maven POM.xml - Run tests from Maven build - Run tests from Java IDE - Enables syntax highlighting and code completion --- .github/workflows/ci-build.yml | 2 +- .github/workflows/yaks-tests.yaml | 21 +- pom.xml | 27 +++ test/Makefile | 42 ---- test/avro-data-type/avro-data-type.feature | 22 -- test/avro-serdes-action/User.avsc | 23 -- .../avro-serdes-action.feature | 22 -- test/insert-field-action/yaks-config.yaml | 41 ---- test/rest-openapi-sink/yaks-config.yaml | 43 ---- test/timer-source/yaks-config.yaml | 41 ---- .../camel-kamelets-itest}/README.md | 7 +- tests/camel-kamelets-itest/pom.xml | 224 ++++++++++++++++++ .../src/test/java/KameletsYaksIT.java | 34 +++ .../src/test/java/YaksAutoConfiguration.java | 22 ++ .../src/test/resources}/User.avsc | 0 .../test/resources}/amazonDDBClient.groovy | 0 .../src/test/resources}/amazonS3Client.groovy | 0 .../resources/avro-binary-source-pipe.yaml | 2 +- .../test/resources/avro-deserialize-pipe.yaml | 2 +- .../test/resources/avro-serialize-pipe.yaml | 2 +- .../resources/avro-x-struct-sink-pipe.yaml | 2 +- .../src/test/resources/avro}/README.md | 0 .../resources/avro/avro-data-type.feature | 22 ++ .../resources/avro/avro-serdes-action.feature | 22 ++ .../src/test/resources/avro}/yaks-config.yaml | 6 +- .../test/resources}/aws-ddb-sink-pipe.yaml | 0 .../resources}/aws-s3-credentials.properties | 0 .../src/test/resources}/aws-s3-to-http.yaml | 0 .../resources}/aws-s3-to-knative-broker.yaml | 0 .../resources}/aws-s3-to-knative-channel.yaml | 0 .../aws-s3-to-log-secret-based.groovy | 0 .../resources}/aws-s3-to-log-uri-based.groovy | 0 .../src/test/resources}/aws-s3-uri-pipe.yaml | 0 .../aws/ddb}/aws-ddb-sink-deleteItem.feature | 7 +- .../aws/ddb}/aws-ddb-sink-putItem.feature | 9 +- .../aws/ddb}/aws-ddb-sink-updateItem.feature | 7 +- .../test/resources/aws/ddb}/yaks-config.yaml | 8 +- .../src/test/resources/aws/s3}/README.md | 0 .../aws/s3}/aws-s3-knative-broker.feature | 8 +- .../aws/s3}/aws-s3-knative-channel.feature | 8 +- .../s3}/aws-s3-knative-cloudevents.feature | 8 +- .../s3}/aws-s3-source-property-conf.feature | 8 +- .../aws/s3}/aws-s3-source-secret-conf.feature | 8 +- .../aws/s3}/aws-s3-source-uri-conf.feature | 8 +- .../resources/aws/s3}/aws-s3-to-http.feature | 9 +- .../resources/aws/s3}/aws-s3-uri-pipe.feature | 8 +- .../test/resources/aws/s3}/yaks-config.yaml | 18 +- .../resources/citrus-application.properties | 21 ++ .../src/test/resources/cucumber.properties | 26 +- .../resources}/data-type-action-pipe.yaml | 0 .../direct-to-salesforce-delete-pipe.yaml | 0 .../direct-to-salesforce-update-pipe.yaml | 0 .../test/resources}/earthquake-to-http.yaml | 0 .../earthquake}/earthquake-source.feature | 3 +- .../resources/earthquake}/yaks-config.yaml | 0 .../resources}/extract-field-action-pipe.yaml | 0 .../resources}/insert-field-action-pipe.yaml | 0 .../src/test/resources}/kafka-sink-pipe.yaml | 0 .../test/resources}/kafka-source-pipe.yaml | 0 .../src/test/resources}/kafka/install.sh | 0 .../test/resources}/kafka/kafka-sink.feature | 0 .../resources}/kafka/kafka-source.feature | 1 + .../src/test/resources}/kafka/uninstall.sh | 0 .../test/resources}/kafka/yaks-config.yaml | 4 +- .../resources}/knative-channel-to-log.yaml | 0 .../src/test/resources}/knative-to-log.yaml | 0 .../src/test/resources/log4j2-test.xml | 31 +++ .../src/test/resources}/mail-server.groovy | 0 .../test/resources/mail}/mail-sink.feature | 0 .../src/test/resources/mail}/yaks-config.yaml | 4 +- .../src/test/resources}/openapi.json | 0 .../openapi}/rest-openapi-sink.feature | 1 + .../test/resources/openapi}/yaks-config.yaml | 6 +- .../src/test/resources}/pet.json | 0 .../src/test/resources}/putItem.groovy | 0 .../resources}/rest-openapi-sink-pipe.yaml | 0 .../salesforce-credentials.properties | 0 .../resources/salesforce}/delete-secret.sh | 0 .../resources/salesforce}/prepare-secret.sh | 0 .../salesforce}/salesforce-sink.feature | 0 .../resources/salesforce}/yaks-config.yaml | 8 +- .../src/test/resources}/timer-to-http.groovy | 1 + .../test/resources/timer-to-http.properties | 0 .../src/test/resources}/timer-to-http.yaml | 0 .../src/test/resources}/timer-to-mail.yaml | 0 .../resources}/timer-to-salesforce-pipe.yaml | 0 .../resources/timer}/timer-source.feature | 3 +- .../resources/timer}/timer-to-http.feature | 6 +- .../test/resources/timer}/yaks-config.yaml | 4 +- .../test/resources/transformation}/README.md | 0 .../transformation}/data-type-action.feature | 1 + .../extract-field-action.feature | 1 + .../insert-field-action.feature | 3 +- .../transformation}/yaks-config.yaml | 6 +- .../src/test/resources}/verifyItems.groovy | 0 95 files changed, 515 insertions(+), 358 deletions(-) delete mode 100644 test/Makefile delete mode 100644 test/avro-data-type/avro-data-type.feature delete mode 100644 test/avro-serdes-action/User.avsc delete mode 100644 test/avro-serdes-action/avro-serdes-action.feature delete mode 100644 test/insert-field-action/yaks-config.yaml delete mode 100644 test/rest-openapi-sink/yaks-config.yaml delete mode 100644 test/timer-source/yaks-config.yaml rename {test => tests/camel-kamelets-itest}/README.md (74%) create mode 100644 tests/camel-kamelets-itest/pom.xml create mode 100644 tests/camel-kamelets-itest/src/test/java/KameletsYaksIT.java create mode 100644 tests/camel-kamelets-itest/src/test/java/YaksAutoConfiguration.java rename {test/avro-data-type => tests/camel-kamelets-itest/src/test/resources}/User.avsc (100%) rename {test/aws-ddb-sink => tests/camel-kamelets-itest/src/test/resources}/amazonDDBClient.groovy (100%) rename {test/aws-s3 => tests/camel-kamelets-itest/src/test/resources}/amazonS3Client.groovy (100%) rename test/avro-data-type/json-to-avro-pipe.yaml => tests/camel-kamelets-itest/src/test/resources/avro-binary-source-pipe.yaml (98%) rename test/avro-serdes-action/avro-to-log-pipe.yaml => tests/camel-kamelets-itest/src/test/resources/avro-deserialize-pipe.yaml (98%) rename test/avro-serdes-action/json-to-avro-pipe.yaml => tests/camel-kamelets-itest/src/test/resources/avro-serialize-pipe.yaml (98%) rename test/avro-data-type/avro-to-log-pipe.yaml => tests/camel-kamelets-itest/src/test/resources/avro-x-struct-sink-pipe.yaml (98%) rename {test/avro-serdes-action => tests/camel-kamelets-itest/src/test/resources/avro}/README.md (100%) create mode 100644 tests/camel-kamelets-itest/src/test/resources/avro/avro-data-type.feature create mode 100644 tests/camel-kamelets-itest/src/test/resources/avro/avro-serdes-action.feature rename {test/data-type-action => tests/camel-kamelets-itest/src/test/resources/avro}/yaks-config.yaml (89%) rename {test/aws-ddb-sink => tests/camel-kamelets-itest/src/test/resources}/aws-ddb-sink-pipe.yaml (100%) rename {test/aws-s3 => tests/camel-kamelets-itest/src/test/resources}/aws-s3-credentials.properties (100%) rename {test/aws-s3 => tests/camel-kamelets-itest/src/test/resources}/aws-s3-to-http.yaml (100%) rename {test/aws-s3 => tests/camel-kamelets-itest/src/test/resources}/aws-s3-to-knative-broker.yaml (100%) rename {test/aws-s3 => tests/camel-kamelets-itest/src/test/resources}/aws-s3-to-knative-channel.yaml (100%) rename {test/aws-s3 => tests/camel-kamelets-itest/src/test/resources}/aws-s3-to-log-secret-based.groovy (100%) rename {test/aws-s3 => tests/camel-kamelets-itest/src/test/resources}/aws-s3-to-log-uri-based.groovy (100%) rename {test/aws-s3 => tests/camel-kamelets-itest/src/test/resources}/aws-s3-uri-pipe.yaml (100%) rename {test/aws-ddb-sink => tests/camel-kamelets-itest/src/test/resources/aws/ddb}/aws-ddb-sink-deleteItem.feature (97%) rename {test/aws-ddb-sink => tests/camel-kamelets-itest/src/test/resources/aws/ddb}/aws-ddb-sink-putItem.feature (96%) rename {test/aws-ddb-sink => tests/camel-kamelets-itest/src/test/resources/aws/ddb}/aws-ddb-sink-updateItem.feature (97%) rename {test/aws-ddb-sink => tests/camel-kamelets-itest/src/test/resources/aws/ddb}/yaks-config.yaml (93%) rename {test/aws-s3 => tests/camel-kamelets-itest/src/test/resources/aws/s3}/README.md (100%) rename {test/aws-s3 => tests/camel-kamelets-itest/src/test/resources/aws/s3}/aws-s3-knative-broker.feature (95%) rename {test/aws-s3 => tests/camel-kamelets-itest/src/test/resources/aws/s3}/aws-s3-knative-channel.feature (95%) rename {test/aws-s3 => tests/camel-kamelets-itest/src/test/resources/aws/s3}/aws-s3-knative-cloudevents.feature (96%) rename {test/aws-s3 => tests/camel-kamelets-itest/src/test/resources/aws/s3}/aws-s3-source-property-conf.feature (93%) rename {test/aws-s3 => tests/camel-kamelets-itest/src/test/resources/aws/s3}/aws-s3-source-secret-conf.feature (95%) rename {test/aws-s3 => tests/camel-kamelets-itest/src/test/resources/aws/s3}/aws-s3-source-uri-conf.feature (93%) rename {test/aws-s3 => tests/camel-kamelets-itest/src/test/resources/aws/s3}/aws-s3-to-http.feature (94%) rename {test/aws-s3 => tests/camel-kamelets-itest/src/test/resources/aws/s3}/aws-s3-uri-pipe.feature (93%) rename {test/aws-s3 => tests/camel-kamelets-itest/src/test/resources/aws/s3}/yaks-config.yaml (85%) create mode 100644 tests/camel-kamelets-itest/src/test/resources/citrus-application.properties rename test/timer-to-http/yaks-config.yaml => tests/camel-kamelets-itest/src/test/resources/cucumber.properties (55%) rename {test/data-type-action => tests/camel-kamelets-itest/src/test/resources}/data-type-action-pipe.yaml (100%) rename {test/salesforce-sink => tests/camel-kamelets-itest/src/test/resources}/direct-to-salesforce-delete-pipe.yaml (100%) rename {test/salesforce-sink => tests/camel-kamelets-itest/src/test/resources}/direct-to-salesforce-update-pipe.yaml (100%) rename {test/earthquake-source => tests/camel-kamelets-itest/src/test/resources}/earthquake-to-http.yaml (100%) rename {test/earthquake-source => tests/camel-kamelets-itest/src/test/resources/earthquake}/earthquake-source.feature (96%) rename {test/earthquake-source => tests/camel-kamelets-itest/src/test/resources/earthquake}/yaks-config.yaml (100%) rename {test/extract-field-action => tests/camel-kamelets-itest/src/test/resources}/extract-field-action-pipe.yaml (100%) rename {test/insert-field-action => tests/camel-kamelets-itest/src/test/resources}/insert-field-action-pipe.yaml (100%) rename {test/kafka => tests/camel-kamelets-itest/src/test/resources}/kafka-sink-pipe.yaml (100%) rename {test/kafka => tests/camel-kamelets-itest/src/test/resources}/kafka-source-pipe.yaml (100%) rename {test => tests/camel-kamelets-itest/src/test/resources}/kafka/install.sh (100%) rename {test => tests/camel-kamelets-itest/src/test/resources}/kafka/kafka-sink.feature (100%) rename {test => tests/camel-kamelets-itest/src/test/resources}/kafka/kafka-source.feature (98%) rename {test => tests/camel-kamelets-itest/src/test/resources}/kafka/uninstall.sh (100%) rename {test => tests/camel-kamelets-itest/src/test/resources}/kafka/yaks-config.yaml (96%) rename {test/aws-s3/utils => tests/camel-kamelets-itest/src/test/resources}/knative-channel-to-log.yaml (100%) rename {test/aws-s3/utils => tests/camel-kamelets-itest/src/test/resources}/knative-to-log.yaml (100%) create mode 100644 tests/camel-kamelets-itest/src/test/resources/log4j2-test.xml rename {test/mail-sink => tests/camel-kamelets-itest/src/test/resources}/mail-server.groovy (100%) rename {test/mail-sink => tests/camel-kamelets-itest/src/test/resources/mail}/mail-sink.feature (100%) rename {test/mail-sink => tests/camel-kamelets-itest/src/test/resources/mail}/yaks-config.yaml (96%) rename {test/rest-openapi-sink => tests/camel-kamelets-itest/src/test/resources}/openapi.json (100%) rename {test/rest-openapi-sink => tests/camel-kamelets-itest/src/test/resources/openapi}/rest-openapi-sink.feature (98%) rename {test/avro-serdes-action => tests/camel-kamelets-itest/src/test/resources/openapi}/yaks-config.yaml (94%) rename {test/rest-openapi-sink => tests/camel-kamelets-itest/src/test/resources}/pet.json (100%) rename {test/aws-ddb-sink => tests/camel-kamelets-itest/src/test/resources}/putItem.groovy (100%) rename {test/rest-openapi-sink => tests/camel-kamelets-itest/src/test/resources}/rest-openapi-sink-pipe.yaml (100%) rename {test/salesforce-sink => tests/camel-kamelets-itest/src/test/resources}/salesforce-credentials.properties (100%) rename {test/salesforce-sink => tests/camel-kamelets-itest/src/test/resources/salesforce}/delete-secret.sh (100%) rename {test/salesforce-sink => tests/camel-kamelets-itest/src/test/resources/salesforce}/prepare-secret.sh (100%) rename {test/salesforce-sink => tests/camel-kamelets-itest/src/test/resources/salesforce}/salesforce-sink.feature (100%) rename {test/salesforce-sink => tests/camel-kamelets-itest/src/test/resources/salesforce}/yaks-config.yaml (89%) rename {test/timer-to-http => tests/camel-kamelets-itest/src/test/resources}/timer-to-http.groovy (99%) rename test/timer-to-http/application.properties => tests/camel-kamelets-itest/src/test/resources/timer-to-http.properties (100%) rename {test/timer-source => tests/camel-kamelets-itest/src/test/resources}/timer-to-http.yaml (100%) rename {test/mail-sink => tests/camel-kamelets-itest/src/test/resources}/timer-to-mail.yaml (100%) rename {test/salesforce-sink => tests/camel-kamelets-itest/src/test/resources}/timer-to-salesforce-pipe.yaml (100%) rename {test/timer-source => tests/camel-kamelets-itest/src/test/resources/timer}/timer-source.feature (95%) rename {test/timer-to-http => tests/camel-kamelets-itest/src/test/resources/timer}/timer-to-http.feature (80%) rename {test/extract-field-action => tests/camel-kamelets-itest/src/test/resources/timer}/yaks-config.yaml (93%) rename {test/avro-data-type => tests/camel-kamelets-itest/src/test/resources/transformation}/README.md (100%) rename {test/data-type-action => tests/camel-kamelets-itest/src/test/resources/transformation}/data-type-action.feature (96%) rename {test/extract-field-action => tests/camel-kamelets-itest/src/test/resources/transformation}/extract-field-action.feature (97%) rename {test/insert-field-action => tests/camel-kamelets-itest/src/test/resources/transformation}/insert-field-action.feature (96%) rename {test/avro-data-type => tests/camel-kamelets-itest/src/test/resources/transformation}/yaks-config.yaml (92%) rename {test/aws-ddb-sink => tests/camel-kamelets-itest/src/test/resources}/verifyItems.groovy (100%) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 4fdb72e83..6aca8b87c 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -84,6 +84,6 @@ jobs: distribution: 'temurin' java-version: 17 - name: Deploy to ASF Snapshots Repository - # Deploy both artifacts and sources (may be required by Camel K) + # Deploy both artifacts and sources (maybe required by Camel K) run: | ./mvnw ${MAVEN_ARGS} clean deploy -DskipTests -DskipITs --settings .github/asf-deploy-settings.xml diff --git a/.github/workflows/yaks-tests.yaml b/.github/workflows/yaks-tests.yaml index 6c2c386f8..92e4f76d1 100644 --- a/.github/workflows/yaks-tests.yaml +++ b/.github/workflows/yaks-tests.yaml @@ -40,9 +40,6 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }} cancel-in-progress: true -env: - YAKS_VERSION: 0.17.1 - jobs: test: runs-on: ubuntu-latest @@ -59,18 +56,7 @@ jobs: cache: 'maven' - name: Build Kamelet libraries run: | - ./mvnw clean install -DskipTests - - name: Get YAKS CLI - run: | - curl --fail -L --silent https://github.com/citrusframework/yaks/releases/download/v${YAKS_VERSION}/yaks-${YAKS_VERSION}-linux-64bit.tar.gz -o yaks.tar.gz - mkdir -p _yaks - tar -zxf yaks.tar.gz --directory ./_yaks - sudo mv ./_yaks/yaks /usr/local/bin/ - rm yaks.tar.gz - rm -r _yaks - - name: Info - run: | - yaks version + ./mvnw clean install -DskipTests -DskipITs - name: YAKS Tests run: | echo "Install JBang via SDKMAN" @@ -87,10 +73,9 @@ jobs: echo "Running YAKS tests for Kamelets" - cd test - make yaks + ./mvnw clean verify -pl :camel-kamelets-itest -Denable.yaks.tests - uses: actions/upload-artifact@v3 if: failure() with: name: dumps - path: test/**/.yaks-jbang + path: tests/camel-kamelets-itest/.yaks-jbang diff --git a/pom.xml b/pom.xml index 8039af92b..9764597a6 100644 --- a/pom.xml +++ b/pom.xml @@ -39,6 +39,7 @@ library/kamelets-maven-plugin library/camel-kamelets-utils library/camel-kamelets-bom + tests/camel-kamelets-itest @@ -50,6 +51,7 @@ UTF-8 3.1.0 3.1.1 + 3.2.2 3.2.2 3.6.3 3.6.0 @@ -63,6 +65,10 @@ 4.2.0 2.0.1 + 4.0.2 + 7.14.0 + 0.17.1 + 2.11.0 @@ -258,6 +264,27 @@ false + + org.apache.maven.plugins + maven-failsafe-plugin + ${maven-failsafe-plugin.version} + + + integration-tests + + integration-test + verify + + + false + + + + + false + false + + org.apache.maven.plugins maven-compiler-plugin diff --git a/test/Makefile b/test/Makefile deleted file mode 100644 index 6d8d2acca..000000000 --- a/test/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -# 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. - -camel-version := 4.2.0 -camel-kamelets-version := 4.3.0-SNAPSHOT -kamelets-local-dir := ../../../kamelets -test := . - -YAKS_RUN_OPTIONS := --timeout=15m --local -e YAKS_CAMELK_MAX_ATTEMPTS=10 -e YAKS_JBANG_CAMEL_VERSION=$(camel-version) -e YAKS_JBANG_KAMELETS_VERSION=$(camel-kamelets-version) -e YAKS_JBANG_KAMELETS_LOCAL_DIR=$(kamelets-local-dir) -e YAKS_KAMELET_API_VERSION=$(kamelet-api-version) - -default: all - -check-setup: - @java -version - @jbang version - @yaks version - @jbang camel@apache/camel --version - @echo "Test setup - OK" - -all: check-setup - @echo "Running YAKS tests" - @echo # - yaks run . $(YAKS_RUN_OPTIONS) - -yaks: check-setup - @echo "Running YAKS test" - @echo # - yaks run $(test) $(YAKS_RUN_OPTIONS) - -.PHONY: all, yaks diff --git a/test/avro-data-type/avro-data-type.feature b/test/avro-data-type/avro-data-type.feature deleted file mode 100644 index 79fc83dab..000000000 --- a/test/avro-data-type/avro-data-type.feature +++ /dev/null @@ -1,22 +0,0 @@ -Feature: Avro data type - - Scenario: Create Kamelet Pipes - Given variable uuid is "citrus:randomUUID()" - Given variable user is - """ - { "id": "${uuid}", "firstname": "Sheldon", "lastname": "Cooper", "age": 28 } - """ - # Create avro-to-log binding - When load Pipe avro-to-log-pipe.yaml - Then Camel K integration avro-to-log-pipe should be running - - # Create json-to-avro binding - When load Pipe json-to-avro-pipe.yaml - Then Camel K integration json-to-avro-pipe should be running - - # Verify output message sent - Then Camel K integration avro-to-log-pipe should print Body: { "id" : "${uuid}", "firstname" : "Sheldon", "lastname" : "Cooper", "age" : 28} - - Scenario: Remove resources - Given delete Pipe avro-to-log-pipe - Given delete Pipe json-to-avro-pipe diff --git a/test/avro-serdes-action/User.avsc b/test/avro-serdes-action/User.avsc deleted file mode 100644 index a2d21f3b3..000000000 --- a/test/avro-serdes-action/User.avsc +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "User", - "type": "record", - "namespace": "demo.kamelets", - "fields": [ - { - "name": "id", - "type": "string" - }, - { - "name": "firstname", - "type": "string" - }, - { - "name": "lastname", - "type": "string" - }, - { - "name": "age", - "type": "int" - }, - ] -} diff --git a/test/avro-serdes-action/avro-serdes-action.feature b/test/avro-serdes-action/avro-serdes-action.feature deleted file mode 100644 index d812102cc..000000000 --- a/test/avro-serdes-action/avro-serdes-action.feature +++ /dev/null @@ -1,22 +0,0 @@ -Feature: Avro serialize/deserialize action - - Scenario: Create Kamelet Pipes - Given variable uuid is "citrus:randomUUID()" - Given variable user is - """ - { "id": "${uuid}", "firstname": "Sheldon", "lastname": "Cooper", "age": 28 } - """ - # Create avro-to-log binding - When load Pipe avro-to-log-pipe.yaml - Then Camel K integration avro-to-log-pipe should be running - - # Create json-to-avro binding - When load Pipe json-to-avro-pipe.yaml - Then Camel K integration json-to-avro-pipe should be running - - # Verify output message sent - Then Camel K integration avro-to-log-pipe should print Body: { "id" : "${uuid}", "firstname" : "Sheldon", "lastname" : "Cooper", "age" : 28} - - Scenario: Remove resources - Given delete Pipe avro-to-log-pipe - Given delete Pipe json-to-avro-pipe diff --git a/test/insert-field-action/yaks-config.yaml b/test/insert-field-action/yaks-config.yaml deleted file mode 100644 index 2c7834fe7..000000000 --- a/test/insert-field-action/yaks-config.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# --------------------------------------------------------------------------- -# 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. -# --------------------------------------------------------------------------- - -config: - namespace: - temporary: false - runtime: - env: - - name: YAKS_CAMELK_AUTO_REMOVE_RESOURCES - value: false - - name: YAKS_KUBERNETES_AUTO_REMOVE_RESOURCES - value: false - - name: YAKS_JBANG_CAMEL_DUMP_INTEGRATION_OUTPUT - value: true - settings: - loggers: - - name: INTEGRATION_STATUS - level: INFO - - name: INTEGRATION_LOGS - level: INFO - resources: - - insert-field-action-pipe.yaml - dump: - enabled: true - failedOnly: true - includes: - - app=camel-k diff --git a/test/rest-openapi-sink/yaks-config.yaml b/test/rest-openapi-sink/yaks-config.yaml deleted file mode 100644 index f819b5b4c..000000000 --- a/test/rest-openapi-sink/yaks-config.yaml +++ /dev/null @@ -1,43 +0,0 @@ -# --------------------------------------------------------------------------- -# 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. -# --------------------------------------------------------------------------- - -config: - namespace: - temporary: false - runtime: - env: - - name: YAKS_CAMELK_AUTO_REMOVE_RESOURCES - value: false - - name: YAKS_KUBERNETES_AUTO_REMOVE_RESOURCES - value: false - - name: YAKS_JBANG_CAMEL_DUMP_INTEGRATION_OUTPUT - value: true - settings: - loggers: - - name: INTEGRATION_STATUS - level: INFO - - name: INTEGRATION_LOGS - level: INFO - resources: - - pet.json - - openapi.json - - rest-openapi-sink-pipe.yaml - dump: - enabled: true - failedOnly: true - includes: - - app=camel-k diff --git a/test/timer-source/yaks-config.yaml b/test/timer-source/yaks-config.yaml deleted file mode 100644 index dd0b980d2..000000000 --- a/test/timer-source/yaks-config.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# --------------------------------------------------------------------------- -# 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. -# --------------------------------------------------------------------------- - -config: - namespace: - temporary: false - runtime: - env: - - name: YAKS_CAMELK_AUTO_REMOVE_RESOURCES - value: false - - name: YAKS_KUBERNETES_AUTO_REMOVE_RESOURCES - value: false - - name: YAKS_JBANG_CAMEL_DUMP_INTEGRATION_OUTPUT - value: true - settings: - loggers: - - name: INTEGRATION_STATUS - level: INFO - - name: INTEGRATION_LOGS - level: INFO - resources: - - timer-to-http.yaml - dump: - enabled: true - failedOnly: true - includes: - - app=camel-k diff --git a/test/README.md b/tests/camel-kamelets-itest/README.md similarity index 74% rename from test/README.md rename to tests/camel-kamelets-itest/README.md index 4ca6f3cd2..20780017d 100644 --- a/test/README.md +++ b/tests/camel-kamelets-itest/README.md @@ -11,7 +11,7 @@ You need the following tools to run the tests: Once everything is set you just need to run ```console - make yaks + mvn verify -Denable.yaks.tests ``` This runs all available YAKS tests that are not marked as `@ignored`. @@ -19,9 +19,8 @@ This runs all available YAKS tests that are not marked as `@ignored`. You can run individual tests when specifying its folder or feature file name. ```console - make yaks test=timer-source/timer-source.feature + mvn verify -Dcucumber.feature=aws/s3/aws-s3-to-http.feature -Denable.yaks.tests ``` -The Makefile is a wrapper for the YAKS binary which is able to run the BDD Gherkin feature files. -You can also run YAKS tooling directly form your local machine. +You can run the tests also from your favorite Java IDE. By default, the YAKS tests use local runtime where Camel integrations, Kamelets, bindings and pipes are run with Camel JBang. diff --git a/tests/camel-kamelets-itest/pom.xml b/tests/camel-kamelets-itest/pom.xml new file mode 100644 index 000000000..69da01f0f --- /dev/null +++ b/tests/camel-kamelets-itest/pom.xml @@ -0,0 +1,224 @@ + + + + 4.0.0 + + + org.apache.camel.kamelets + camel-kamelets-parent + 4.3.0-SNAPSHOT + ../../pom.xml + + + camel-kamelets-itest + jar + + Camel Kamelets Integration Tests + Camel Kamelets Integration Tests + + + *YaksIT + + + + + + org.citrusframework + citrus-bom + ${citrus.version} + pom + import + + + + + + + + io.cucumber + cucumber-junit + ${cucumber.version} + test + + + io.cucumber + cucumber-spring + ${cucumber.version} + test + + + + + org.apache.camel + camel-core + ${camel.version} + test + + + org.apache.camel + camel-jackson + ${camel.version} + test + + + org.apache.camel + camel-aws2-s3 + ${camel.version} + test + + + org.apache.camel + camel-aws2-ddb + ${camel.version} + test + + + + + org.citrusframework + citrus-base + test + + + org.citrusframework + citrus-spring + test + + + org.citrusframework + citrus-junit + test + + + org.citrusframework + citrus-mail + test + + + org.citrusframework + citrus-validation-text + test + + + org.citrusframework + citrus-validation-json + test + + + + + org.citrusframework.yaks + yaks-standard + ${yaks.version} + test + + + org.citrusframework.yaks + yaks-http + ${yaks.version} + test + + + org.citrusframework.yaks + yaks-kubernetes + ${yaks.version} + test + + + org.citrusframework.yaks + yaks-knative + ${yaks.version} + test + + + org.citrusframework.yaks + yaks-kafka + ${yaks.version} + test + + + org.citrusframework.yaks + yaks-groovy + ${yaks.version} + test + + + org.citrusframework.yaks + yaks-camel + ${yaks.version} + test + + + org.citrusframework.yaks + yaks-camel-k + ${yaks.version} + test + + + org.citrusframework.yaks + yaks-testcontainers + ${yaks.version} + test + + + org.citrusframework.yaks + yaks-jdbc + ${yaks.version} + test + + + + + org.apache.logging.log4j + log4j-api + ${log4j2-version} + test + + + org.apache.logging.log4j + log4j-core + ${log4j2-version} + test + + + org.apache.logging.log4j + log4j-slf4j2-impl + ${log4j2-version} + test + + + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${maven-failsafe-plugin.version} + + + ${enable.yaks.tests} + + + + + + + diff --git a/tests/camel-kamelets-itest/src/test/java/KameletsYaksIT.java b/tests/camel-kamelets-itest/src/test/java/KameletsYaksIT.java new file mode 100644 index 000000000..deb5875bb --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/java/KameletsYaksIT.java @@ -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. + */ + +import io.cucumber.junit.Cucumber; +import io.cucumber.junit.CucumberOptions; +import io.cucumber.spring.CucumberContextConfiguration; +import org.citrusframework.config.CitrusSpringConfig; +import org.junit.runner.RunWith; +import org.springframework.test.context.ContextConfiguration; + +@CucumberContextConfiguration +@ContextConfiguration(classes = CitrusSpringConfig.class) +@RunWith(Cucumber.class) +@CucumberOptions( + extraGlue = "org.citrusframework.yaks", + plugin = { "pretty", "org.citrusframework.yaks.report.TestReporter" } +) +public class KameletsYaksIT { + +} diff --git a/tests/camel-kamelets-itest/src/test/java/YaksAutoConfiguration.java b/tests/camel-kamelets-itest/src/test/java/YaksAutoConfiguration.java new file mode 100644 index 000000000..44018b8a7 --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/java/YaksAutoConfiguration.java @@ -0,0 +1,22 @@ +import org.citrusframework.functions.DefaultFunctionLibrary; +import org.citrusframework.functions.FunctionLibrary; +import org.citrusframework.yaks.report.SystemOutTestReporter; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class YaksAutoConfiguration { + + @Bean + public SystemOutTestReporter systemOutReporter() { + return new SystemOutTestReporter(); + } + + @Bean + public FunctionLibrary yaksFunctionLibrary() { + FunctionLibrary lib = new FunctionLibrary(); + lib.setPrefix("yaks:"); + lib.getMembers().putAll(new DefaultFunctionLibrary().getMembers()); + return lib; + } +} diff --git a/test/avro-data-type/User.avsc b/tests/camel-kamelets-itest/src/test/resources/User.avsc similarity index 100% rename from test/avro-data-type/User.avsc rename to tests/camel-kamelets-itest/src/test/resources/User.avsc diff --git a/test/aws-ddb-sink/amazonDDBClient.groovy b/tests/camel-kamelets-itest/src/test/resources/amazonDDBClient.groovy similarity index 100% rename from test/aws-ddb-sink/amazonDDBClient.groovy rename to tests/camel-kamelets-itest/src/test/resources/amazonDDBClient.groovy diff --git a/test/aws-s3/amazonS3Client.groovy b/tests/camel-kamelets-itest/src/test/resources/amazonS3Client.groovy similarity index 100% rename from test/aws-s3/amazonS3Client.groovy rename to tests/camel-kamelets-itest/src/test/resources/amazonS3Client.groovy diff --git a/test/avro-data-type/json-to-avro-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/avro-binary-source-pipe.yaml similarity index 98% rename from test/avro-data-type/json-to-avro-pipe.yaml rename to tests/camel-kamelets-itest/src/test/resources/avro-binary-source-pipe.yaml index d74304050..adc3ab27b 100644 --- a/test/avro-data-type/json-to-avro-pipe.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/avro-binary-source-pipe.yaml @@ -18,7 +18,7 @@ apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: json-to-avro-pipe + name: avro-binary-source-pipe spec: integration: dependencies: diff --git a/test/avro-serdes-action/avro-to-log-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/avro-deserialize-pipe.yaml similarity index 98% rename from test/avro-serdes-action/avro-to-log-pipe.yaml rename to tests/camel-kamelets-itest/src/test/resources/avro-deserialize-pipe.yaml index 21ea16dbf..492cfde85 100644 --- a/test/avro-serdes-action/avro-to-log-pipe.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/avro-deserialize-pipe.yaml @@ -18,7 +18,7 @@ apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: avro-to-log-pipe + name: avro-deserialize-pipe spec: source: ref: diff --git a/test/avro-serdes-action/json-to-avro-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/avro-serialize-pipe.yaml similarity index 98% rename from test/avro-serdes-action/json-to-avro-pipe.yaml rename to tests/camel-kamelets-itest/src/test/resources/avro-serialize-pipe.yaml index aef7bab1d..5d18e1784 100644 --- a/test/avro-serdes-action/json-to-avro-pipe.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/avro-serialize-pipe.yaml @@ -18,7 +18,7 @@ apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: json-to-avro-pipe + name: avro-serialize-pipe spec: source: ref: diff --git a/test/avro-data-type/avro-to-log-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/avro-x-struct-sink-pipe.yaml similarity index 98% rename from test/avro-data-type/avro-to-log-pipe.yaml rename to tests/camel-kamelets-itest/src/test/resources/avro-x-struct-sink-pipe.yaml index 992113263..613cd3bd3 100644 --- a/test/avro-data-type/avro-to-log-pipe.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/avro-x-struct-sink-pipe.yaml @@ -18,7 +18,7 @@ apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: avro-to-log-pipe + name: avro-x-struct-sink-pipe spec: integration: dependencies: diff --git a/test/avro-serdes-action/README.md b/tests/camel-kamelets-itest/src/test/resources/avro/README.md similarity index 100% rename from test/avro-serdes-action/README.md rename to tests/camel-kamelets-itest/src/test/resources/avro/README.md diff --git a/tests/camel-kamelets-itest/src/test/resources/avro/avro-data-type.feature b/tests/camel-kamelets-itest/src/test/resources/avro/avro-data-type.feature new file mode 100644 index 000000000..b7f684e42 --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/avro/avro-data-type.feature @@ -0,0 +1,22 @@ +Feature: Avro data type + + Scenario: Create Kamelet Pipes + Given variable uuid is "citrus:randomUUID()" + Given variable user is + """ + { "id": "${uuid}", "firstname": "Sheldon", "lastname": "Cooper", "age": 28 } + """ + # Create avro-to-log binding + When load Pipe avro-x-struct-sink-pipe.yaml + Then Camel K integration avro-x-struct-sink-pipe should be running + + # Create json-to-avro binding + When load Pipe avro-binary-source-pipe.yaml + Then Camel K integration avro-binary-source-pipe should be running + + # Verify output message sent + Then Camel K integration avro-x-struct-sink-pipe should print Body: { "id" : "${uuid}", "firstname" : "Sheldon", "lastname" : "Cooper", "age" : 28} + + Scenario: Remove resources + Given delete Pipe avro-x-struct-sink-pipe + Given delete Pipe avro-binary-source-pipe diff --git a/tests/camel-kamelets-itest/src/test/resources/avro/avro-serdes-action.feature b/tests/camel-kamelets-itest/src/test/resources/avro/avro-serdes-action.feature new file mode 100644 index 000000000..c5b2ac84a --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/avro/avro-serdes-action.feature @@ -0,0 +1,22 @@ +Feature: Avro serialize/deserialize action + + Scenario: Create Kamelet Pipes + Given variable uuid is "citrus:randomUUID()" + Given variable user is + """ + { "id": "${uuid}", "firstname": "Sheldon", "lastname": "Cooper", "age": 28 } + """ + # Create avro-to-log binding + When load Pipe avro-deserialize-pipe.yaml + Then Camel K integration avro-deserialize-pipe should be running + + # Create json-to-avro binding + When load Pipe avro-serialize-pipe.yaml + Then Camel K integration avro-serialize-pipe should be running + + # Verify output message sent + Then Camel K integration avro-deserialize-pipe should print Body: { "id" : "${uuid}", "firstname" : "Sheldon", "lastname" : "Cooper", "age" : 28} + + Scenario: Remove resources + Given delete Pipe avro-deserialize-pipe + Given delete Pipe avro-serialize-pipe diff --git a/test/data-type-action/yaks-config.yaml b/tests/camel-kamelets-itest/src/test/resources/avro/yaks-config.yaml similarity index 89% rename from test/data-type-action/yaks-config.yaml rename to tests/camel-kamelets-itest/src/test/resources/avro/yaks-config.yaml index 1b6f93b1c..941e00148 100644 --- a/test/data-type-action/yaks-config.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/avro/yaks-config.yaml @@ -33,7 +33,11 @@ config: - name: INTEGRATION_LOGS level: INFO resources: - - data-type-action-pipe.yaml + - ../avro-serialize-pipe.yaml + - ../avro-deserialize-pipe.yaml + - ../avro-binary-source-pipe.yaml + - ../avro-x-struct-sink-pipe.yaml + - ../User.avsc dump: enabled: true failedOnly: true diff --git a/test/aws-ddb-sink/aws-ddb-sink-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/aws-ddb-sink-pipe.yaml similarity index 100% rename from test/aws-ddb-sink/aws-ddb-sink-pipe.yaml rename to tests/camel-kamelets-itest/src/test/resources/aws-ddb-sink-pipe.yaml diff --git a/test/aws-s3/aws-s3-credentials.properties b/tests/camel-kamelets-itest/src/test/resources/aws-s3-credentials.properties similarity index 100% rename from test/aws-s3/aws-s3-credentials.properties rename to tests/camel-kamelets-itest/src/test/resources/aws-s3-credentials.properties diff --git a/test/aws-s3/aws-s3-to-http.yaml b/tests/camel-kamelets-itest/src/test/resources/aws-s3-to-http.yaml similarity index 100% rename from test/aws-s3/aws-s3-to-http.yaml rename to tests/camel-kamelets-itest/src/test/resources/aws-s3-to-http.yaml diff --git a/test/aws-s3/aws-s3-to-knative-broker.yaml b/tests/camel-kamelets-itest/src/test/resources/aws-s3-to-knative-broker.yaml similarity index 100% rename from test/aws-s3/aws-s3-to-knative-broker.yaml rename to tests/camel-kamelets-itest/src/test/resources/aws-s3-to-knative-broker.yaml diff --git a/test/aws-s3/aws-s3-to-knative-channel.yaml b/tests/camel-kamelets-itest/src/test/resources/aws-s3-to-knative-channel.yaml similarity index 100% rename from test/aws-s3/aws-s3-to-knative-channel.yaml rename to tests/camel-kamelets-itest/src/test/resources/aws-s3-to-knative-channel.yaml diff --git a/test/aws-s3/aws-s3-to-log-secret-based.groovy b/tests/camel-kamelets-itest/src/test/resources/aws-s3-to-log-secret-based.groovy similarity index 100% rename from test/aws-s3/aws-s3-to-log-secret-based.groovy rename to tests/camel-kamelets-itest/src/test/resources/aws-s3-to-log-secret-based.groovy diff --git a/test/aws-s3/aws-s3-to-log-uri-based.groovy b/tests/camel-kamelets-itest/src/test/resources/aws-s3-to-log-uri-based.groovy similarity index 100% rename from test/aws-s3/aws-s3-to-log-uri-based.groovy rename to tests/camel-kamelets-itest/src/test/resources/aws-s3-to-log-uri-based.groovy diff --git a/test/aws-s3/aws-s3-uri-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/aws-s3-uri-pipe.yaml similarity index 100% rename from test/aws-s3/aws-s3-uri-pipe.yaml rename to tests/camel-kamelets-itest/src/test/resources/aws-s3-uri-pipe.yaml diff --git a/test/aws-ddb-sink/aws-ddb-sink-deleteItem.feature b/tests/camel-kamelets-itest/src/test/resources/aws/ddb/aws-ddb-sink-deleteItem.feature similarity index 97% rename from test/aws-ddb-sink/aws-ddb-sink-deleteItem.feature rename to tests/camel-kamelets-itest/src/test/resources/aws/ddb/aws-ddb-sink-deleteItem.feature index 979b1f158..7f45f1d09 100644 --- a/test/aws-ddb-sink/aws-ddb-sink-deleteItem.feature +++ b/tests/camel-kamelets-itest/src/test/resources/aws/ddb/aws-ddb-sink-deleteItem.feature @@ -31,18 +31,17 @@ Feature: AWS DDB Sink - DeleteItem # Start LocalStack container Given Enable service DYNAMODB Given start LocalStack container + + Scenario: Verify AWS-DDB Kamelet sink binding # Create AWS-DDB client - Given New global Camel context Given load to Camel registry amazonDDBClient.groovy - - Scenario: Create item on AWS-DDB Given run script putItem.groovy Given variables | maxRetryAttempts | 20 | | aws.ddb.items | [[year:AttributeValue(N=${aws.ddb.item.year}), id:AttributeValue(N=${aws.ddb.item.id}), title:AttributeValue(S=${aws.ddb.item.title})]] | + # Create item on AWS-DDB Then apply actions verifyItems.groovy - Scenario: Verify AWS-DDB Kamelet sink binding # Create binding When load Pipe aws-ddb-sink-pipe.yaml And Pipe aws-ddb-sink-pipe is available diff --git a/test/aws-ddb-sink/aws-ddb-sink-putItem.feature b/tests/camel-kamelets-itest/src/test/resources/aws/ddb/aws-ddb-sink-putItem.feature similarity index 96% rename from test/aws-ddb-sink/aws-ddb-sink-putItem.feature rename to tests/camel-kamelets-itest/src/test/resources/aws/ddb/aws-ddb-sink-putItem.feature index df3ee8fc0..f9b889ac9 100644 --- a/test/aws-ddb-sink/aws-ddb-sink-putItem.feature +++ b/tests/camel-kamelets-itest/src/test/resources/aws/ddb/aws-ddb-sink-putItem.feature @@ -31,17 +31,16 @@ Feature: AWS DDB Sink - PutItem # Start LocalStack container Given Enable service DYNAMODB Given start LocalStack container - # Create AWS-DDB client - Given New global Camel context - Given load to Camel registry amazonDDBClient.groovy - Scenario: Verify empty items on AWS-DDB + Scenario: Verify AWS-DDB Kamelet sink binding Given variables | maxRetryAttempts | 20 | | aws.ddb.items | [] | + # Create AWS-DDB client + Given load to Camel registry amazonDDBClient.groovy + # Verify empty items on AWS-DDB Then apply actions verifyItems.groovy - Scenario: Verify AWS-DDB Kamelet sink binding # Create binding When load Pipe aws-ddb-sink-pipe.yaml And Pipe aws-ddb-sink-pipe is available diff --git a/test/aws-ddb-sink/aws-ddb-sink-updateItem.feature b/tests/camel-kamelets-itest/src/test/resources/aws/ddb/aws-ddb-sink-updateItem.feature similarity index 97% rename from test/aws-ddb-sink/aws-ddb-sink-updateItem.feature rename to tests/camel-kamelets-itest/src/test/resources/aws/ddb/aws-ddb-sink-updateItem.feature index 8a987d6a4..956c5d1ea 100644 --- a/test/aws-ddb-sink/aws-ddb-sink-updateItem.feature +++ b/tests/camel-kamelets-itest/src/test/resources/aws/ddb/aws-ddb-sink-updateItem.feature @@ -33,18 +33,17 @@ Feature: AWS DDB Sink - UpdateItem # Start LocalStack container Given Enable service DYNAMODB Given start LocalStack container + + Scenario: Verify AWS-DDB Kamelet sink binding # Create AWS-DDB client - Given New global Camel context Given load to Camel registry amazonDDBClient.groovy - - Scenario: Create item on AWS-DDB + # Create item on AWS-DDB Given run script putItem.groovy Given variables | maxRetryAttempts | 20 | | aws.ddb.items | [[year:AttributeValue(N=${aws.ddb.item.year}), id:AttributeValue(N=${aws.ddb.item.id}), title:AttributeValue(S=${aws.ddb.item.title})]] | Then apply actions verifyItems.groovy - Scenario: Verify AWS-DDB Kamelet sink binding # Create binding When load Pipe aws-ddb-sink-pipe.yaml And Pipe aws-ddb-sink-pipe is available diff --git a/test/aws-ddb-sink/yaks-config.yaml b/tests/camel-kamelets-itest/src/test/resources/aws/ddb/yaks-config.yaml similarity index 93% rename from test/aws-ddb-sink/yaks-config.yaml rename to tests/camel-kamelets-itest/src/test/resources/aws/ddb/yaks-config.yaml index dbd40ded4..1e1a00147 100644 --- a/test/aws-ddb-sink/yaks-config.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/aws/ddb/yaks-config.yaml @@ -35,10 +35,10 @@ config: - name: CITRUS_TYPE_CONVERTER value: camel resources: - - putItem.groovy - - verifyItems.groovy - - amazonDDBClient.groovy - - aws-ddb-sink-pipe.yaml + - ../../putItem.groovy + - ../../verifyItems.groovy + - ../../amazonDDBClient.groovy + - ../../aws-ddb-sink-pipe.yaml cucumber: tags: - "not @ignored" diff --git a/test/aws-s3/README.md b/tests/camel-kamelets-itest/src/test/resources/aws/s3/README.md similarity index 100% rename from test/aws-s3/README.md rename to tests/camel-kamelets-itest/src/test/resources/aws/s3/README.md diff --git a/test/aws-s3/aws-s3-knative-broker.feature b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-knative-broker.feature similarity index 95% rename from test/aws-s3/aws-s3-knative-broker.feature rename to tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-knative-broker.feature index 3974e7035..9282a218a 100644 --- a/test/aws-s3/aws-s3-knative-broker.feature +++ b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-knative-broker.feature @@ -1,5 +1,5 @@ @knative -Feature: AWS S3 Kamelet - Knative broker binding +Feature: AWS S3 Source - Knative broker binding Background: Given Knative event consumer timeout is 20000 ms @@ -14,9 +14,6 @@ Feature: AWS S3 Kamelet - Knative broker binding # Start LocalStack container Given Enable service S3 Given start LocalStack container - # Create AWS-S3 client - Given New global Camel context - Given load to Camel registry amazonS3Client.groovy # Create Knative broker Given create Knative broker default And Knative broker default is running @@ -27,6 +24,9 @@ Feature: AWS S3 Kamelet - Knative broker binding And Pipe aws-s3-to-knative-broker is available And Camel K integration aws-s3-to-knative-broker is running Then Camel K integration aws-s3-to-knative-broker should print Started aws-s3-to-knative-broker + # Create AWS-S3 client + Given New Camel context + Given load to Camel registry amazonS3Client.groovy # Verify Kamelet source Given create Knative event consumer service event-consumer-service Given create Knative trigger event-service-trigger on service event-consumer-service with filter on attributes diff --git a/test/aws-s3/aws-s3-knative-channel.feature b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-knative-channel.feature similarity index 95% rename from test/aws-s3/aws-s3-knative-channel.feature rename to tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-knative-channel.feature index b2b449596..87b21837b 100644 --- a/test/aws-s3/aws-s3-knative-channel.feature +++ b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-knative-channel.feature @@ -1,5 +1,5 @@ @knative -Feature: AWS S3 Kamelet - binding to Knative channel +Feature: AWS S3 Source - binding to Knative channel Background: Given variables @@ -11,9 +11,6 @@ Feature: AWS S3 Kamelet - binding to Knative channel # Start LocalStack container Given Enable service S3 Given start LocalStack container - # Create AWS-S3 client - Given New global Camel context - Given load to Camel registry amazonS3Client.groovy # Create Knative broker and channel Given create Knative broker default And Knative broker default is running @@ -30,6 +27,9 @@ Feature: AWS S3 Kamelet - binding to Knative channel And Camel K integration aws-s3-to-knative-channel should print Started aws-s3-to-knative-channel And Camel K integration knative-channel-to-log should print Installed features Then sleep 10000 ms + # Create AWS-S3 client + Given New Camel context + Given load to Camel registry amazonS3Client.groovy # Verify Kamelet source Given Camel exchange message header CamelAwsS3Key="${aws.s3.key}" Given send Camel exchange to("aws2-s3://${aws.s3.bucketNameOrArn}?amazonS3Client=#amazonS3Client") with body: ${aws.s3.message} diff --git a/test/aws-s3/aws-s3-knative-cloudevents.feature b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-knative-cloudevents.feature similarity index 96% rename from test/aws-s3/aws-s3-knative-cloudevents.feature rename to tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-knative-cloudevents.feature index c3d1fd379..eb9cc70d3 100644 --- a/test/aws-s3/aws-s3-knative-cloudevents.feature +++ b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-knative-cloudevents.feature @@ -1,5 +1,5 @@ @knative -Feature: AWS S3 Kamelet - cloud events data type +Feature: AWS S3 Source - cloud events data type Background: Given Knative event consumer timeout is 20000 ms @@ -14,9 +14,6 @@ Feature: AWS S3 Kamelet - cloud events data type # Start LocalStack container Given Enable service S3 Given start LocalStack container - # Create AWS-S3 client - Given New global Camel context - Given load to Camel registry amazonS3Client.groovy # Create Knative broker Given create Knative broker default And Knative broker default is running @@ -27,6 +24,9 @@ Feature: AWS S3 Kamelet - cloud events data type And Pipe aws-s3-to-knative-broker is available And Camel K integration aws-s3-to-knative-broker is running Then Camel K integration aws-s3-to-knative-broker should print Started aws-s3-to-knative-broker + # Create AWS-S3 client + Given New Camel context + Given load to Camel registry amazonS3Client.groovy # Verify Kamelet source Given create Knative event consumer service event-consumer-service Given create Knative trigger event-service-trigger on service event-consumer-service with filter on attributes diff --git a/test/aws-s3/aws-s3-source-property-conf.feature b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-source-property-conf.feature similarity index 93% rename from test/aws-s3/aws-s3-source-property-conf.feature rename to tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-source-property-conf.feature index 89363ca33..fe29ad155 100644 --- a/test/aws-s3/aws-s3-source-property-conf.feature +++ b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-source-property-conf.feature @@ -1,4 +1,4 @@ -Feature: AWS S3 Kamelet - property based config +Feature: AWS S3 Source - property based config Background: Given variables @@ -10,9 +10,6 @@ Feature: AWS S3 Kamelet - property based config # Start LocalStack container Given Enable service S3 Given start LocalStack container - # Create AWS-S3 client - Given New global Camel context - Given load to Camel registry amazonS3Client.groovy Scenario: Verify AWS-S3 Kamelet to log binding # Create binding @@ -23,6 +20,9 @@ Feature: AWS S3 Kamelet - property based config .to("log:info") """ Then Camel K integration aws-s3-to-log-prop-based should be running + # Create AWS-S3 client + Given New Camel context + Given load to Camel registry amazonS3Client.groovy # Verify Kamelet source Given Camel exchange message header CamelAwsS3Key="${aws.s3.key}" Given send Camel exchange to("aws2-s3://${aws.s3.bucketNameOrArn}?amazonS3Client=#amazonS3Client") with body: ${aws.s3.message} diff --git a/test/aws-s3/aws-s3-source-secret-conf.feature b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-source-secret-conf.feature similarity index 95% rename from test/aws-s3/aws-s3-source-secret-conf.feature rename to tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-source-secret-conf.feature index c18dff104..138c68e03 100644 --- a/test/aws-s3/aws-s3-source-secret-conf.feature +++ b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-source-secret-conf.feature @@ -1,5 +1,5 @@ @ignored -Feature: AWS S3 Kamelet - secret based config +Feature: AWS S3 Source - secret based config Background: Given variables @@ -11,9 +11,6 @@ Feature: AWS S3 Kamelet - secret based config # Start LocalStack container Given Enable service S3 Given start LocalStack container - # Create AWS-S3 client - Given New global Camel context - Given load to Camel registry amazonS3Client.groovy # Create Kubernetes secret Given create Kubernetes secret aws-s3-source-credentials | aws-s3-credentials.properties | citrus:encodeBase64(citrus:readFile(aws-s3-credentials.properties)) | @@ -25,6 +22,9 @@ Feature: AWS S3 Kamelet - secret based config | camel.apache.org/kamelet.configuration | aws-s3-credentials | Given load Camel K integration aws-s3-to-log-secret-based.groovy Then Camel K integration aws-s3-to-log-secret-based should be running + # Create AWS-S3 client + Given New Camel context + Given load to Camel registry amazonS3Client.groovy # Verify Kamelet source Given Camel exchange message header CamelAwsS3Key="${aws.s3.key}" Given send Camel exchange to("aws2-s3://${aws.s3.bucketNameOrArn}?amazonS3Client=#amazonS3Client") with body: ${aws.s3.message} diff --git a/test/aws-s3/aws-s3-source-uri-conf.feature b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-source-uri-conf.feature similarity index 93% rename from test/aws-s3/aws-s3-source-uri-conf.feature rename to tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-source-uri-conf.feature index 281d0e98d..4042dceba 100644 --- a/test/aws-s3/aws-s3-source-uri-conf.feature +++ b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-source-uri-conf.feature @@ -1,4 +1,4 @@ -Feature: AWS S3 Kamelet - URI based config +Feature: AWS S3 Source - URI based config Background: Given variables @@ -10,14 +10,14 @@ Feature: AWS S3 Kamelet - URI based config # Start LocalStack container Given Enable service S3 Given start LocalStack container - # Create AWS-S3 client - Given New global Camel context - Given load to Camel registry amazonS3Client.groovy Scenario: Verify AWS-S3 Kamelet to log binding # Create binding Given load Camel K integration aws-s3-to-log-uri-based.groovy Then Camel K integration aws-s3-to-log-uri-based should be running + # Create AWS-S3 client + Given New Camel context + Given load to Camel registry amazonS3Client.groovy # Verify Kamelet source Given Camel exchange message header CamelAwsS3Key="${aws.s3.key}" Given send Camel exchange to("aws2-s3://${aws.s3.bucketNameOrArn}?amazonS3Client=#amazonS3Client") with body: ${aws.s3.message} diff --git a/test/aws-s3/aws-s3-to-http.feature b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-to-http.feature similarity index 94% rename from test/aws-s3/aws-s3-to-http.feature rename to tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-to-http.feature index 14031cfe2..675492615 100644 --- a/test/aws-s3/aws-s3-to-http.feature +++ b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-to-http.feature @@ -1,4 +1,4 @@ -Feature: AWS S3 Kamelet - Http sink +Feature: AWS S3 Source - Http sink Background: Given Kubernetes timeout is 60000 ms @@ -12,12 +12,10 @@ Feature: AWS S3 Kamelet - Http sink Scenario: Create infrastructure # Create Http server Given create Kubernetes service test-service + Given purge endpoint test-service # Start LocalStack container Given Enable service S3 Given start LocalStack container - # Create AWS-S3 client - Given New global Camel context - Given load to Camel registry amazonS3Client.groovy Scenario: Verify AWS-S3 Kamelet to Http # Create binding @@ -25,6 +23,9 @@ Feature: AWS S3 Kamelet - Http sink And Pipe aws-s3-to-http is available And Camel K integration aws-s3-to-http is running Then Camel K integration aws-s3-to-http should print (aws-s3-to-http) started + # Create AWS-S3 client + Given New Camel context + Given load to Camel registry amazonS3Client.groovy # Verify Kamelet source Given Camel exchange message header CamelAwsS3Key="${aws.s3.key}" Given send Camel exchange to("aws2-s3://${aws.s3.bucketNameOrArn}?amazonS3Client=#amazonS3Client") with body: ${aws.s3.message} diff --git a/test/aws-s3/aws-s3-uri-pipe.feature b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-uri-pipe.feature similarity index 93% rename from test/aws-s3/aws-s3-uri-pipe.feature rename to tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-uri-pipe.feature index 432cec5b2..3be46dd79 100644 --- a/test/aws-s3/aws-s3-uri-pipe.feature +++ b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-uri-pipe.feature @@ -1,4 +1,4 @@ -Feature: AWS S3 Kamelet - binding to URI +Feature: AWS S3 Source - binding to URI Background: Given variables @@ -10,9 +10,6 @@ Feature: AWS S3 Kamelet - binding to URI # Start LocalStack container Given Enable service S3 Given start LocalStack container - # Create AWS-S3 client - Given New global Camel context - Given load to Camel registry amazonS3Client.groovy Scenario: Verify AWS-S3 Kamelet to log binding # Create binding @@ -20,6 +17,9 @@ Feature: AWS S3 Kamelet - binding to URI And Pipe aws-s3-uri-pipe is available And Camel K integration aws-s3-uri-pipe is running Then Camel K integration aws-s3-uri-pipe should print Started aws-s3-uri-pipe + # Create AWS-S3 client + Given New Camel context + Given load to Camel registry amazonS3Client.groovy # Verify Kamelet source Given Camel exchange message header CamelAwsS3Key="${aws.s3.key}" Given send Camel exchange to("aws2-s3://${aws.s3.bucketNameOrArn}?amazonS3Client=#amazonS3Client") with body: ${aws.s3.message} diff --git a/test/aws-s3/yaks-config.yaml b/tests/camel-kamelets-itest/src/test/resources/aws/s3/yaks-config.yaml similarity index 85% rename from test/aws-s3/yaks-config.yaml rename to tests/camel-kamelets-itest/src/test/resources/aws/s3/yaks-config.yaml index 5df6816b3..2518c34e7 100644 --- a/test/aws-s3/yaks-config.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/aws/s3/yaks-config.yaml @@ -39,15 +39,15 @@ config: - name: CITRUS_TYPE_CONVERTER value: camel resources: - - amazonS3Client.groovy - - aws-s3-credentials.properties - - aws-s3-to-log-uri-based.groovy - - aws-s3-to-log-secret-based.groovy - - aws-s3-uri-pipe.yaml - - aws-s3-to-http.yaml - - aws-s3-to-knative-channel.yaml - - aws-s3-to-knative-broker.yaml - - utils/knative-channel-to-log.yaml + - ../../amazonS3Client.groovy + - ../../aws-s3-credentials.properties + - ../../aws-s3-to-log-uri-based.groovy + - ../../aws-s3-to-log-secret-based.groovy + - ../../aws-s3-uri-pipe.yaml + - ../../aws-s3-to-http.yaml + - ../../aws-s3-to-knative-channel.yaml + - ../../aws-s3-to-knative-broker.yaml + - ../../knative-channel-to-log.yaml cucumber: tags: - "not @ignored and not @knative" diff --git a/tests/camel-kamelets-itest/src/test/resources/citrus-application.properties b/tests/camel-kamelets-itest/src/test/resources/citrus-application.properties new file mode 100644 index 000000000..3fa21d13d --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/citrus-application.properties @@ -0,0 +1,21 @@ +citrus.spring.java.config=YaksAutoConfiguration + +citrus.file.encoding=UTF-8 + +citrus.default.message.type=JSON +citrus.type.converter=camel + +yaks.cluster.type=local +yaks.camelk.max.attempts=10 + +yaks.jbang.camel.version=4.2.0 +yaks.jbang.kamelets.version=4.3.0-SNAPSHOT + +yaks.jbang.kamelets.local.dir=../../../kamelets +yaks.jbang.camel.dump.integration.output=true + +yaks.kubernetes.auto.remove.resources=false +yaks.knative.auto.remove.resources=false +yaks.camelk.auto.remove.resources=false +yaks.kamelets.auto.remove.resources=false +yaks.testcontainers.auto.remove.resources=false diff --git a/test/timer-to-http/yaks-config.yaml b/tests/camel-kamelets-itest/src/test/resources/cucumber.properties similarity index 55% rename from test/timer-to-http/yaks-config.yaml rename to tests/camel-kamelets-itest/src/test/resources/cucumber.properties index a7387ea3f..4a022c942 100644 --- a/test/timer-to-http/yaks-config.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/cucumber.properties @@ -1,6 +1,6 @@ -# --------------------------------------------------------------------------- +# # Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with +# 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 @@ -13,21 +13,9 @@ # 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. -# --------------------------------------------------------------------------- +# + +cucumber.object-factory=org.citrusframework.cucumber.backend.spring.CitrusSpringObjectFactory +cucumber.publish.quiet=true -config: - namespace: - temporary: false - runtime: - env: - - name: YAKS_JBANG_CAMEL_DUMP_INTEGRATION_OUTPUT - value: true - settings: - loggers: - - name: INTEGRATION_STATUS - level: INFO - - name: INTEGRATION_LOGS - level: INFO - resources: - - timer-to-http.groovy - - application.properties +cucumber.filter.tags=not @ignored and not @knative diff --git a/test/data-type-action/data-type-action-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/data-type-action-pipe.yaml similarity index 100% rename from test/data-type-action/data-type-action-pipe.yaml rename to tests/camel-kamelets-itest/src/test/resources/data-type-action-pipe.yaml diff --git a/test/salesforce-sink/direct-to-salesforce-delete-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/direct-to-salesforce-delete-pipe.yaml similarity index 100% rename from test/salesforce-sink/direct-to-salesforce-delete-pipe.yaml rename to tests/camel-kamelets-itest/src/test/resources/direct-to-salesforce-delete-pipe.yaml diff --git a/test/salesforce-sink/direct-to-salesforce-update-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/direct-to-salesforce-update-pipe.yaml similarity index 100% rename from test/salesforce-sink/direct-to-salesforce-update-pipe.yaml rename to tests/camel-kamelets-itest/src/test/resources/direct-to-salesforce-update-pipe.yaml diff --git a/test/earthquake-source/earthquake-to-http.yaml b/tests/camel-kamelets-itest/src/test/resources/earthquake-to-http.yaml similarity index 100% rename from test/earthquake-source/earthquake-to-http.yaml rename to tests/camel-kamelets-itest/src/test/resources/earthquake-to-http.yaml diff --git a/test/earthquake-source/earthquake-source.feature b/tests/camel-kamelets-itest/src/test/resources/earthquake/earthquake-source.feature similarity index 96% rename from test/earthquake-source/earthquake-source.feature rename to tests/camel-kamelets-itest/src/test/resources/earthquake/earthquake-source.feature index 36281729d..70350aea8 100644 --- a/test/earthquake-source/earthquake-source.feature +++ b/tests/camel-kamelets-itest/src/test/resources/earthquake/earthquake-source.feature @@ -15,7 +15,7 @@ # limitations under the License. # --------------------------------------------------------------------------- -Feature: Kamelet earthquake-source +Feature: Earthquake source Background: Given HTTP server timeout is 150000 ms @@ -23,6 +23,7 @@ Feature: Kamelet earthquake-source Scenario: Create Http server Given create Kubernetes service test-service with target port 8080 + Given purge endpoint test-service Scenario: Create Kamelet binding Given load Pipe earthquake-to-http.yaml diff --git a/test/earthquake-source/yaks-config.yaml b/tests/camel-kamelets-itest/src/test/resources/earthquake/yaks-config.yaml similarity index 100% rename from test/earthquake-source/yaks-config.yaml rename to tests/camel-kamelets-itest/src/test/resources/earthquake/yaks-config.yaml diff --git a/test/extract-field-action/extract-field-action-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/extract-field-action-pipe.yaml similarity index 100% rename from test/extract-field-action/extract-field-action-pipe.yaml rename to tests/camel-kamelets-itest/src/test/resources/extract-field-action-pipe.yaml diff --git a/test/insert-field-action/insert-field-action-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/insert-field-action-pipe.yaml similarity index 100% rename from test/insert-field-action/insert-field-action-pipe.yaml rename to tests/camel-kamelets-itest/src/test/resources/insert-field-action-pipe.yaml diff --git a/test/kafka/kafka-sink-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/kafka-sink-pipe.yaml similarity index 100% rename from test/kafka/kafka-sink-pipe.yaml rename to tests/camel-kamelets-itest/src/test/resources/kafka-sink-pipe.yaml diff --git a/test/kafka/kafka-source-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/kafka-source-pipe.yaml similarity index 100% rename from test/kafka/kafka-source-pipe.yaml rename to tests/camel-kamelets-itest/src/test/resources/kafka-source-pipe.yaml diff --git a/test/kafka/install.sh b/tests/camel-kamelets-itest/src/test/resources/kafka/install.sh similarity index 100% rename from test/kafka/install.sh rename to tests/camel-kamelets-itest/src/test/resources/kafka/install.sh diff --git a/test/kafka/kafka-sink.feature b/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-sink.feature similarity index 100% rename from test/kafka/kafka-sink.feature rename to tests/camel-kamelets-itest/src/test/resources/kafka/kafka-sink.feature diff --git a/test/kafka/kafka-source.feature b/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-source.feature similarity index 98% rename from test/kafka/kafka-source.feature rename to tests/camel-kamelets-itest/src/test/resources/kafka/kafka-source.feature index a265ad7d0..2c1cca686 100644 --- a/test/kafka/kafka-source.feature +++ b/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-source.feature @@ -34,6 +34,7 @@ Feature: Kafka Kamelet source Scenario: Create infrastructure Given start Redpanda container Given create Kubernetes service test-service with target port 8080 + Given purge endpoint test-service Scenario: Create Kamelet binding When load Pipe kafka-source-pipe.yaml diff --git a/test/kafka/uninstall.sh b/tests/camel-kamelets-itest/src/test/resources/kafka/uninstall.sh similarity index 100% rename from test/kafka/uninstall.sh rename to tests/camel-kamelets-itest/src/test/resources/kafka/uninstall.sh diff --git a/test/kafka/yaks-config.yaml b/tests/camel-kamelets-itest/src/test/resources/kafka/yaks-config.yaml similarity index 96% rename from test/kafka/yaks-config.yaml rename to tests/camel-kamelets-itest/src/test/resources/kafka/yaks-config.yaml index 63ba6c1db..8613dfeb1 100644 --- a/test/kafka/yaks-config.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/kafka/yaks-config.yaml @@ -37,8 +37,8 @@ config: - name: INTEGRATION_LOGS level: INFO resources: - - kafka-source-pipe.yaml - - kafka-sink-pipe.yaml + - ../kafka-source-pipe.yaml + - ../kafka-sink-pipe.yaml dump: enabled: true failedOnly: true diff --git a/test/aws-s3/utils/knative-channel-to-log.yaml b/tests/camel-kamelets-itest/src/test/resources/knative-channel-to-log.yaml similarity index 100% rename from test/aws-s3/utils/knative-channel-to-log.yaml rename to tests/camel-kamelets-itest/src/test/resources/knative-channel-to-log.yaml diff --git a/test/aws-s3/utils/knative-to-log.yaml b/tests/camel-kamelets-itest/src/test/resources/knative-to-log.yaml similarity index 100% rename from test/aws-s3/utils/knative-to-log.yaml rename to tests/camel-kamelets-itest/src/test/resources/knative-to-log.yaml diff --git a/tests/camel-kamelets-itest/src/test/resources/log4j2-test.xml b/tests/camel-kamelets-itest/src/test/resources/log4j2-test.xml new file mode 100644 index 000000000..394d9d3d1 --- /dev/null +++ b/tests/camel-kamelets-itest/src/test/resources/log4j2-test.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + diff --git a/test/mail-sink/mail-server.groovy b/tests/camel-kamelets-itest/src/test/resources/mail-server.groovy similarity index 100% rename from test/mail-sink/mail-server.groovy rename to tests/camel-kamelets-itest/src/test/resources/mail-server.groovy diff --git a/test/mail-sink/mail-sink.feature b/tests/camel-kamelets-itest/src/test/resources/mail/mail-sink.feature similarity index 100% rename from test/mail-sink/mail-sink.feature rename to tests/camel-kamelets-itest/src/test/resources/mail/mail-sink.feature diff --git a/test/mail-sink/yaks-config.yaml b/tests/camel-kamelets-itest/src/test/resources/mail/yaks-config.yaml similarity index 96% rename from test/mail-sink/yaks-config.yaml rename to tests/camel-kamelets-itest/src/test/resources/mail/yaks-config.yaml index ddf676ee2..84fd7dacc 100644 --- a/test/mail-sink/yaks-config.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/mail/yaks-config.yaml @@ -37,8 +37,8 @@ config: artifactId: citrus-mail version: "@citrus.version@" resources: - - mail-server.groovy - - timer-to-mail.yaml + - ../mail-server.groovy + - ../timer-to-mail.yaml dump: enabled: true failedOnly: true diff --git a/test/rest-openapi-sink/openapi.json b/tests/camel-kamelets-itest/src/test/resources/openapi.json similarity index 100% rename from test/rest-openapi-sink/openapi.json rename to tests/camel-kamelets-itest/src/test/resources/openapi.json diff --git a/test/rest-openapi-sink/rest-openapi-sink.feature b/tests/camel-kamelets-itest/src/test/resources/openapi/rest-openapi-sink.feature similarity index 98% rename from test/rest-openapi-sink/rest-openapi-sink.feature rename to tests/camel-kamelets-itest/src/test/resources/openapi/rest-openapi-sink.feature index d38643f44..64269d2fd 100644 --- a/test/rest-openapi-sink/rest-openapi-sink.feature +++ b/tests/camel-kamelets-itest/src/test/resources/openapi/rest-openapi-sink.feature @@ -25,6 +25,7 @@ Feature: REST OpenAPI Kamelet sink Scenario: Create Http server Given create Kubernetes service test-service + Given purge endpoint test-service Scenario: Create Kamelet binding for addPet Given variable operation is "addPet" diff --git a/test/avro-serdes-action/yaks-config.yaml b/tests/camel-kamelets-itest/src/test/resources/openapi/yaks-config.yaml similarity index 94% rename from test/avro-serdes-action/yaks-config.yaml rename to tests/camel-kamelets-itest/src/test/resources/openapi/yaks-config.yaml index 3d4b9e286..93e62d4d0 100644 --- a/test/avro-serdes-action/yaks-config.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/openapi/yaks-config.yaml @@ -33,9 +33,9 @@ config: - name: INTEGRATION_LOGS level: INFO resources: - - json-to-avro-pipe.yaml - - avro-to-log-pipe.yaml - - User.avsc + - ../pet.json + - ../openapi.json + - ../rest-openapi-sink-pipe.yaml dump: enabled: true failedOnly: true diff --git a/test/rest-openapi-sink/pet.json b/tests/camel-kamelets-itest/src/test/resources/pet.json similarity index 100% rename from test/rest-openapi-sink/pet.json rename to tests/camel-kamelets-itest/src/test/resources/pet.json diff --git a/test/aws-ddb-sink/putItem.groovy b/tests/camel-kamelets-itest/src/test/resources/putItem.groovy similarity index 100% rename from test/aws-ddb-sink/putItem.groovy rename to tests/camel-kamelets-itest/src/test/resources/putItem.groovy diff --git a/test/rest-openapi-sink/rest-openapi-sink-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/rest-openapi-sink-pipe.yaml similarity index 100% rename from test/rest-openapi-sink/rest-openapi-sink-pipe.yaml rename to tests/camel-kamelets-itest/src/test/resources/rest-openapi-sink-pipe.yaml diff --git a/test/salesforce-sink/salesforce-credentials.properties b/tests/camel-kamelets-itest/src/test/resources/salesforce-credentials.properties similarity index 100% rename from test/salesforce-sink/salesforce-credentials.properties rename to tests/camel-kamelets-itest/src/test/resources/salesforce-credentials.properties diff --git a/test/salesforce-sink/delete-secret.sh b/tests/camel-kamelets-itest/src/test/resources/salesforce/delete-secret.sh similarity index 100% rename from test/salesforce-sink/delete-secret.sh rename to tests/camel-kamelets-itest/src/test/resources/salesforce/delete-secret.sh diff --git a/test/salesforce-sink/prepare-secret.sh b/tests/camel-kamelets-itest/src/test/resources/salesforce/prepare-secret.sh similarity index 100% rename from test/salesforce-sink/prepare-secret.sh rename to tests/camel-kamelets-itest/src/test/resources/salesforce/prepare-secret.sh diff --git a/test/salesforce-sink/salesforce-sink.feature b/tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-sink.feature similarity index 100% rename from test/salesforce-sink/salesforce-sink.feature rename to tests/camel-kamelets-itest/src/test/resources/salesforce/salesforce-sink.feature diff --git a/test/salesforce-sink/yaks-config.yaml b/tests/camel-kamelets-itest/src/test/resources/salesforce/yaks-config.yaml similarity index 89% rename from test/salesforce-sink/yaks-config.yaml rename to tests/camel-kamelets-itest/src/test/resources/salesforce/yaks-config.yaml index 97e0dea17..ea84f6677 100644 --- a/test/salesforce-sink/yaks-config.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/salesforce/yaks-config.yaml @@ -37,10 +37,10 @@ config: level: INFO secret: salesforce-credentials resources: - - timer-to-salesforce-pipe.yaml - - direct-to-salesforce-update-pipe.yaml - - direct-to-salesforce-delete-pipe.yaml - - salesforce-credentials.properties + - ../timer-to-salesforce-pipe.yaml + - ../direct-to-salesforce-update-pipe.yaml + - ../direct-to-salesforce-delete-pipe.yaml + - ../salesforce-credentials.properties dump: enabled: true failedOnly: true diff --git a/test/timer-to-http/timer-to-http.groovy b/tests/camel-kamelets-itest/src/test/resources/timer-to-http.groovy similarity index 99% rename from test/timer-to-http/timer-to-http.groovy rename to tests/camel-kamelets-itest/src/test/resources/timer-to-http.groovy index 300c5e8da..6b0c86a09 100644 --- a/test/timer-to-http/timer-to-http.groovy +++ b/tests/camel-kamelets-itest/src/test/resources/timer-to-http.groovy @@ -1,3 +1,4 @@ + /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/test/timer-to-http/application.properties b/tests/camel-kamelets-itest/src/test/resources/timer-to-http.properties similarity index 100% rename from test/timer-to-http/application.properties rename to tests/camel-kamelets-itest/src/test/resources/timer-to-http.properties diff --git a/test/timer-source/timer-to-http.yaml b/tests/camel-kamelets-itest/src/test/resources/timer-to-http.yaml similarity index 100% rename from test/timer-source/timer-to-http.yaml rename to tests/camel-kamelets-itest/src/test/resources/timer-to-http.yaml diff --git a/test/mail-sink/timer-to-mail.yaml b/tests/camel-kamelets-itest/src/test/resources/timer-to-mail.yaml similarity index 100% rename from test/mail-sink/timer-to-mail.yaml rename to tests/camel-kamelets-itest/src/test/resources/timer-to-mail.yaml diff --git a/test/salesforce-sink/timer-to-salesforce-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/timer-to-salesforce-pipe.yaml similarity index 100% rename from test/salesforce-sink/timer-to-salesforce-pipe.yaml rename to tests/camel-kamelets-itest/src/test/resources/timer-to-salesforce-pipe.yaml diff --git a/test/timer-source/timer-source.feature b/tests/camel-kamelets-itest/src/test/resources/timer/timer-source.feature similarity index 95% rename from test/timer-source/timer-source.feature rename to tests/camel-kamelets-itest/src/test/resources/timer/timer-source.feature index 7ec9edbe1..2b6d2bdc4 100644 --- a/test/timer-source/timer-source.feature +++ b/tests/camel-kamelets-itest/src/test/resources/timer/timer-source.feature @@ -18,11 +18,12 @@ Feature: Timer Source Kamelet Background: - Given HTTP server timeout is 150000 ms + Given HTTP server timeout is 5000 ms Given HTTP server "test-service" Scenario: Create Http server Given create Kubernetes service test-service with target port 8080 + Given purge endpoint test-service Scenario: Create Kamelet binding And variables diff --git a/test/timer-to-http/timer-to-http.feature b/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http.feature similarity index 80% rename from test/timer-to-http/timer-to-http.feature rename to tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http.feature index 9f8aacb3a..af816d4c4 100644 --- a/test/timer-to-http/timer-to-http.feature +++ b/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http.feature @@ -9,9 +9,10 @@ Feature: Verify Camel K integrations Scenario: Verify timer-to-http integration # Create Http server Given create Kubernetes service test-service with target port 8080 + Given purge endpoint test-service # Run Camel K integration - Given Camel K integration property file application.properties + Given Camel K integration property file timer-to-http.properties When load Camel K integration timer-to-http.groovy Then Camel K integration timer-to-http should be running @@ -23,3 +24,6 @@ Feature: Verify Camel K integrations # Verify Camel K integration logs And Camel K integration timer-to-http should print Thank You! + + Scenario: Remove Camel K resources + Given delete Camel K integration timer-to-http diff --git a/test/extract-field-action/yaks-config.yaml b/tests/camel-kamelets-itest/src/test/resources/timer/yaks-config.yaml similarity index 93% rename from test/extract-field-action/yaks-config.yaml rename to tests/camel-kamelets-itest/src/test/resources/timer/yaks-config.yaml index 902d6daba..41970bbc2 100644 --- a/test/extract-field-action/yaks-config.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/timer/yaks-config.yaml @@ -33,7 +33,9 @@ config: - name: INTEGRATION_LOGS level: INFO resources: - - extract-field-action-pipe.yaml + - ../timer-to-http.yaml + - ../timer-to-http.groovy + - ../timer-to-http.properties dump: enabled: true failedOnly: true diff --git a/test/avro-data-type/README.md b/tests/camel-kamelets-itest/src/test/resources/transformation/README.md similarity index 100% rename from test/avro-data-type/README.md rename to tests/camel-kamelets-itest/src/test/resources/transformation/README.md diff --git a/test/data-type-action/data-type-action.feature b/tests/camel-kamelets-itest/src/test/resources/transformation/data-type-action.feature similarity index 96% rename from test/data-type-action/data-type-action.feature rename to tests/camel-kamelets-itest/src/test/resources/transformation/data-type-action.feature index 9b9b1ffbb..2bc1f8c73 100644 --- a/test/data-type-action/data-type-action.feature +++ b/tests/camel-kamelets-itest/src/test/resources/transformation/data-type-action.feature @@ -6,6 +6,7 @@ Feature: Data type action Scenario: Create Http server Given create Kubernetes service test-service with target port 8080 + Given purge endpoint test-service Scenario: Create Kamelet binding Given variable uuid is "citrus:randomUUID()" diff --git a/test/extract-field-action/extract-field-action.feature b/tests/camel-kamelets-itest/src/test/resources/transformation/extract-field-action.feature similarity index 97% rename from test/extract-field-action/extract-field-action.feature rename to tests/camel-kamelets-itest/src/test/resources/transformation/extract-field-action.feature index f449b64fc..34b5585ff 100644 --- a/test/extract-field-action/extract-field-action.feature +++ b/tests/camel-kamelets-itest/src/test/resources/transformation/extract-field-action.feature @@ -24,6 +24,7 @@ Feature: Extract field Kamelet action Scenario: Create Http server Given create Kubernetes service test-service with target port 8080 + Given purge endpoint test-service Scenario: Create Kamelet binding Given variable input is diff --git a/test/insert-field-action/insert-field-action.feature b/tests/camel-kamelets-itest/src/test/resources/transformation/insert-field-action.feature similarity index 96% rename from test/insert-field-action/insert-field-action.feature rename to tests/camel-kamelets-itest/src/test/resources/transformation/insert-field-action.feature index e241f70f5..a9412cb0d 100644 --- a/test/insert-field-action/insert-field-action.feature +++ b/tests/camel-kamelets-itest/src/test/resources/transformation/insert-field-action.feature @@ -18,7 +18,7 @@ Feature: Insert field Kamelet action Background: - Given HTTP server timeout is 15000 ms + Given HTTP server timeout is 5000 ms Given HTTP server "test-service" Given variables | field | subject | @@ -26,6 +26,7 @@ Feature: Insert field Kamelet action Scenario: Create Http server Given create Kubernetes service test-service with target port 8080 + Given purge endpoint test-service Scenario: Create Kamelet binding Given variable input is diff --git a/test/avro-data-type/yaks-config.yaml b/tests/camel-kamelets-itest/src/test/resources/transformation/yaks-config.yaml similarity index 92% rename from test/avro-data-type/yaks-config.yaml rename to tests/camel-kamelets-itest/src/test/resources/transformation/yaks-config.yaml index 3d4b9e286..e6f6a3a9a 100644 --- a/test/avro-data-type/yaks-config.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/transformation/yaks-config.yaml @@ -33,9 +33,9 @@ config: - name: INTEGRATION_LOGS level: INFO resources: - - json-to-avro-pipe.yaml - - avro-to-log-pipe.yaml - - User.avsc + - ../insert-field-action-pipe.yaml + - ../extract-field-action-pipe.yaml + - ../data-type-action-pipe.yaml dump: enabled: true failedOnly: true diff --git a/test/aws-ddb-sink/verifyItems.groovy b/tests/camel-kamelets-itest/src/test/resources/verifyItems.groovy similarity index 100% rename from test/aws-ddb-sink/verifyItems.groovy rename to tests/camel-kamelets-itest/src/test/resources/verifyItems.groovy