From 87047cb32893ae44697b045ae501a512f39dd63d Mon Sep 17 00:00:00 2001 From: Christoph Deppisch Date: Wed, 31 Jan 2024 10:40:49 +0100 Subject: [PATCH] chore: Fix YAKS tests for 4.4.0-SNAPSHOT - Update Apache Camel runtime to 4.4.0-SNAPSHOT - Use CitrusObjectFactory instead of CitrusSpringObjectFactory as the latter one has open issues - Set timer period to 10000 --- tests/camel-kamelets-itest/pom.xml | 2 +- .../src/test/java/KameletsYaksIT.java | 5 ----- .../src/test/resources/avro-binary-source-pipe.yaml | 2 +- .../src/test/resources/avro-serialize-pipe.yaml | 2 +- .../src/test/resources/aws-s3-to-http.yaml | 7 +++++++ .../src/test/resources/aws/s3/aws-s3-to-http.feature | 2 +- .../src/test/resources/citrus-application.properties | 2 +- .../src/test/resources/cucumber.properties | 2 +- .../src/test/resources/data-type-action-pipe.yaml | 2 +- .../src/test/resources/extract-field-action-pipe.yaml | 2 +- .../src/test/resources/insert-field-action-pipe.yaml | 2 +- .../src/test/resources/kafka-sink-pipe.yaml | 2 +- .../{timer-to-http.yaml => timer-to-http-pipe.yaml} | 3 ++- .../src/test/resources/timer-to-http.groovy | 2 +- .../src/test/resources/timer/timer-source.feature | 10 +++++----- .../src/test/resources/timer/timer-to-http.feature | 1 + .../src/test/resources/timer/yaks-config.yaml | 2 +- 17 files changed, 27 insertions(+), 23 deletions(-) rename tests/camel-kamelets-itest/src/test/resources/{timer-to-http.yaml => timer-to-http-pipe.yaml} (96%) diff --git a/tests/camel-kamelets-itest/pom.xml b/tests/camel-kamelets-itest/pom.xml index 8158138cf..2079a00fa 100644 --- a/tests/camel-kamelets-itest/pom.xml +++ b/tests/camel-kamelets-itest/pom.xml @@ -59,7 +59,7 @@ io.cucumber - cucumber-spring + cucumber-java ${cucumber.version} test diff --git a/tests/camel-kamelets-itest/src/test/java/KameletsYaksIT.java b/tests/camel-kamelets-itest/src/test/java/KameletsYaksIT.java index deb5875bb..50b80bb09 100644 --- a/tests/camel-kamelets-itest/src/test/java/KameletsYaksIT.java +++ b/tests/camel-kamelets-itest/src/test/java/KameletsYaksIT.java @@ -17,13 +17,8 @@ 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", diff --git a/tests/camel-kamelets-itest/src/test/resources/avro-binary-source-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/avro-binary-source-pipe.yaml index adc3ab27b..376a3be89 100644 --- a/tests/camel-kamelets-itest/src/test/resources/avro-binary-source-pipe.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/avro-binary-source-pipe.yaml @@ -29,7 +29,7 @@ spec: apiVersion: camel.apache.org/v1 name: timer-source properties: - period: 5000 + period: 10000 contentType: application/json message: > ${user} diff --git a/tests/camel-kamelets-itest/src/test/resources/avro-serialize-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/avro-serialize-pipe.yaml index 5d18e1784..63495904e 100644 --- a/tests/camel-kamelets-itest/src/test/resources/avro-serialize-pipe.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/avro-serialize-pipe.yaml @@ -26,7 +26,7 @@ spec: apiVersion: camel.apache.org/v1 name: timer-source properties: - period: 5000 + period: 10000 contentType: application/json message: > ${user} diff --git a/tests/camel-kamelets-itest/src/test/resources/aws-s3-to-http.yaml b/tests/camel-kamelets-itest/src/test/resources/aws-s3-to-http.yaml index 702f87181..5135f4488 100644 --- a/tests/camel-kamelets-itest/src/test/resources/aws-s3-to-http.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/aws-s3-to-http.yaml @@ -51,6 +51,13 @@ spec: properties: scheme: "http" format: "application-cloudevents" + - ref: + kind: Kamelet + apiVersion: camel.apache.org/v1 + name: data-type-action + properties: + scheme: "text" + format: "plain" - ref: kind: Kamelet apiVersion: camel.apache.org/v1 diff --git a/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-to-http.feature b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-to-http.feature index 675492615..f040b30ed 100644 --- a/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-to-http.feature +++ b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-to-http.feature @@ -38,7 +38,7 @@ Feature: AWS S3 Source - Http sink | ce-source | aws.s3.bucket.${aws.s3.bucketNameOrArn} | | ce-type | org.apache.camel.event.aws.s3.getObject | | ce-time | @notEmpty()@ | - | Content-Type | application/json;charset=UTF-8 | + | Content-Type | text/plain; charset=UTF-8 | When receive POST /incoming Then send HTTP 201 CREATED diff --git a/tests/camel-kamelets-itest/src/test/resources/citrus-application.properties b/tests/camel-kamelets-itest/src/test/resources/citrus-application.properties index b4e369489..19991c7c8 100644 --- a/tests/camel-kamelets-itest/src/test/resources/citrus-application.properties +++ b/tests/camel-kamelets-itest/src/test/resources/citrus-application.properties @@ -8,7 +8,7 @@ citrus.type.converter=camel yaks.cluster.type=local yaks.camelk.max.attempts=10 -yaks.jbang.camel.version=4.3.0 +yaks.jbang.camel.version=4.4.0-SNAPSHOT yaks.jbang.kamelets.version=4.4.0-SNAPSHOT yaks.jbang.kamelets.local.dir=../../../kamelets diff --git a/tests/camel-kamelets-itest/src/test/resources/cucumber.properties b/tests/camel-kamelets-itest/src/test/resources/cucumber.properties index 4a022c942..91707f3cd 100644 --- a/tests/camel-kamelets-itest/src/test/resources/cucumber.properties +++ b/tests/camel-kamelets-itest/src/test/resources/cucumber.properties @@ -15,7 +15,7 @@ # limitations under the License. # -cucumber.object-factory=org.citrusframework.cucumber.backend.spring.CitrusSpringObjectFactory +cucumber.object-factory=org.citrusframework.cucumber.backend.CitrusObjectFactory cucumber.publish.quiet=true cucumber.filter.tags=not @ignored and not @knative diff --git a/tests/camel-kamelets-itest/src/test/resources/data-type-action-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/data-type-action-pipe.yaml index 3abac9770..06a2b175f 100644 --- a/tests/camel-kamelets-itest/src/test/resources/data-type-action-pipe.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/data-type-action-pipe.yaml @@ -29,7 +29,7 @@ spec: apiVersion: camel.apache.org/v1 name: timer-source properties: - period: 5000 + period: 10000 contentType: application/json message: > ${input} diff --git a/tests/camel-kamelets-itest/src/test/resources/extract-field-action-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/extract-field-action-pipe.yaml index a99654c16..362a80397 100644 --- a/tests/camel-kamelets-itest/src/test/resources/extract-field-action-pipe.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/extract-field-action-pipe.yaml @@ -26,7 +26,7 @@ spec: apiVersion: camel.apache.org/v1 name: timer-source properties: - period: 5000 + period: 10000 contentType: application/json message: > ${input} diff --git a/tests/camel-kamelets-itest/src/test/resources/insert-field-action-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/insert-field-action-pipe.yaml index 2b490ee62..12a13686b 100644 --- a/tests/camel-kamelets-itest/src/test/resources/insert-field-action-pipe.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/insert-field-action-pipe.yaml @@ -26,7 +26,7 @@ spec: apiVersion: camel.apache.org/v1 name: timer-source properties: - period: 5000 + period: 10000 contentType: application/json message: > ${input} diff --git a/tests/camel-kamelets-itest/src/test/resources/kafka-sink-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/kafka-sink-pipe.yaml index ace2dfa59..32a98c4ce 100644 --- a/tests/camel-kamelets-itest/src/test/resources/kafka-sink-pipe.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/kafka-sink-pipe.yaml @@ -26,7 +26,7 @@ spec: apiVersion: camel.apache.org/v1 name: timer-source properties: - period: 5000 + period: 10000 contentType: application/json message: ${message} sink: diff --git a/tests/camel-kamelets-itest/src/test/resources/timer-to-http.yaml b/tests/camel-kamelets-itest/src/test/resources/timer-to-http-pipe.yaml similarity index 96% rename from tests/camel-kamelets-itest/src/test/resources/timer-to-http.yaml rename to tests/camel-kamelets-itest/src/test/resources/timer-to-http-pipe.yaml index 5ccfad21d..e57b14b5e 100644 --- a/tests/camel-kamelets-itest/src/test/resources/timer-to-http.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/timer-to-http-pipe.yaml @@ -18,7 +18,7 @@ apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: timer-to-http + name: timer-to-http-pipe spec: source: ref: @@ -26,6 +26,7 @@ spec: apiVersion: camel.apache.org/v1 name: timer-source properties: + period: 10000 message: "${message}" sink: uri: yaks:resolveURL('test-service')/events diff --git a/tests/camel-kamelets-itest/src/test/resources/timer-to-http.groovy b/tests/camel-kamelets-itest/src/test/resources/timer-to-http.groovy index 6b0c86a09..e1a184d46 100644 --- a/tests/camel-kamelets-itest/src/test/resources/timer-to-http.groovy +++ b/tests/camel-kamelets-itest/src/test/resources/timer-to-http.groovy @@ -18,7 +18,7 @@ // camel-k: language=groovy -from('timer:tick?period=5000') +from('timer:tick?period=10000') .setHeader("CamelHttpMethod", constant("PUT")) .setBody().constant('{{message}}') .to('yaks:resolveURL(test-service)/messages') diff --git a/tests/camel-kamelets-itest/src/test/resources/timer/timer-source.feature b/tests/camel-kamelets-itest/src/test/resources/timer/timer-source.feature index 2b6d2bdc4..ae38394a7 100644 --- a/tests/camel-kamelets-itest/src/test/resources/timer/timer-source.feature +++ b/tests/camel-kamelets-itest/src/test/resources/timer/timer-source.feature @@ -28,10 +28,10 @@ Feature: Timer Source Kamelet Scenario: Create Kamelet binding And variables | message | Hello World | - Given load Pipe timer-to-http.yaml - Then Pipe timer-to-http should be available - Then Camel K integration timer-to-http should be running - And Camel K integration timer-to-http should print Routes startup + Given load Pipe timer-to-http-pipe.yaml + Then Pipe timer-to-http-pipe should be available + Then Camel K integration timer-to-http-pipe should be running + And Camel K integration timer-to-http-pipe should print Routes startup Scenario: Verify binding Given expect HTTP request body: Hello World @@ -39,5 +39,5 @@ Feature: Timer Source Kamelet Then send HTTP 200 OK Scenario: Remove Camel K resources - Given delete Pipe timer-to-http + Given delete Pipe timer-to-http-pipe And delete Kubernetes service test-service diff --git a/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http.feature b/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http.feature index af816d4c4..ccfeb09ac 100644 --- a/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http.feature +++ b/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http.feature @@ -27,3 +27,4 @@ Feature: Verify Camel K integrations Scenario: Remove Camel K resources Given delete Camel K integration timer-to-http + And delete Kubernetes service test-service diff --git a/tests/camel-kamelets-itest/src/test/resources/timer/yaks-config.yaml b/tests/camel-kamelets-itest/src/test/resources/timer/yaks-config.yaml index 41970bbc2..76ff59a62 100644 --- a/tests/camel-kamelets-itest/src/test/resources/timer/yaks-config.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/timer/yaks-config.yaml @@ -33,7 +33,7 @@ config: - name: INTEGRATION_LOGS level: INFO resources: - - ../timer-to-http.yaml + - ../timer-to-http-pipe.yaml - ../timer-to-http.groovy - ../timer-to-http.properties dump: