From 1f0a4a8144931aa1eb0f56429355aad19045cade Mon Sep 17 00:00:00 2001 From: Christoph Deppisch Date: Tue, 28 Jan 2025 13:10:52 +0100 Subject: [PATCH] chore: Improve stability of integration tests - Avoid to use the very same Http server instance for multiple tests - Avoid racing conditions where Http requests are sent by the Camel JBang process after the test has finished - Introduce individual Http server instances for the tests (jiraServer, slackServer, petstoreServer, httpServer) - Better separation of tests due to individual server ports --- .../test/java/EndpointAutoConfiguration.java | 70 ++++++++++++++++++- .../resources/aws/s3/aws-s3-to-http.it.yaml | 3 + .../test/resources/aws/s3/aws-s3-to-http.yaml | 2 +- .../earthquake/earthquake-to-http.it.yaml | 4 ++ .../earthquake/earthquake-to-http.yaml | 2 +- .../jira/jira-add-comment-sink-pipe.it.yaml | 18 ++--- .../jira/jira-add-issue-sink-pipe.it.yaml | 14 ++-- .../resources/jira/jira-source-pipe.it.yaml | 14 ++-- .../resources/kafka/kafka-source-pipe.it.yaml | 3 + .../resources/kafka/kafka-source-pipe.yaml | 2 +- .../openapi/rest-openapi-sink-add-pet.it.yaml | 10 +-- .../rest-openapi-sink-delete-pet.it.yaml | 10 +-- .../openapi/rest-openapi-sink-pipe.yaml | 2 +- .../resources/slack/application.properties | 2 +- .../resources/slack/slack-sink-pipe.it.yaml | 10 +-- .../resources/slack/slack-source-pipe.it.yaml | 18 ++--- .../timer/timer-to-http-pipe.it.yaml | 10 +-- .../resources/timer/timer-to-http-pipe.yaml | 2 +- .../resources/timer/timer-to-http.it.yaml | 10 +-- .../test/resources/timer/timer-to-http.yaml | 2 +- .../data-type-action-pipe.it.yaml | 10 +-- .../transformation/data-type-action-pipe.yaml | 2 +- .../extract-field-action-pipe.it.yaml | 10 +-- .../extract-field-action-pipe.yaml | 2 +- .../insert-field-action-pipe.it.yaml | 10 +-- .../insert-field-action-pipe.yaml | 2 +- 26 files changed, 171 insertions(+), 73 deletions(-) diff --git a/tests/camel-kamelets-itest/src/test/java/EndpointAutoConfiguration.java b/tests/camel-kamelets-itest/src/test/java/EndpointAutoConfiguration.java index f237eb016..87c933057 100644 --- a/tests/camel-kamelets-itest/src/test/java/EndpointAutoConfiguration.java +++ b/tests/camel-kamelets-itest/src/test/java/EndpointAutoConfiguration.java @@ -17,21 +17,52 @@ import org.citrusframework.annotations.CitrusConfiguration; import org.citrusframework.container.SequenceAfterTest; +import org.citrusframework.container.SequenceBeforeTest; import org.citrusframework.http.server.HttpServer; import org.citrusframework.spi.BindToRegistry; +import org.citrusframework.util.SocketUtils; import org.springframework.http.HttpStatus; +import static org.citrusframework.actions.CreateVariablesAction.Builder.createVariables; import static org.citrusframework.actions.PurgeEndpointAction.Builder.purgeEndpoints; import static org.citrusframework.http.endpoint.builder.HttpEndpoints.http; @CitrusConfiguration public class EndpointAutoConfiguration { + private static final long SERVER_TIMEOUT = 60000L; + + private static final int HTTP_SERVER_PORT = SocketUtils.findAvailableTcpPort(8801); + private static final int SLACK_SERVER_PORT = SocketUtils.findAvailableTcpPort(8802); + private static final int PETSTORE_SERVER_PORT = SocketUtils.findAvailableTcpPort(8803); + private static final int JIRA_SERVER_PORT = SocketUtils.findAvailableTcpPort(8804); + private final HttpServer httpServer = http() .server() - .port(8081) + .port(HTTP_SERVER_PORT) + .timeout(SERVER_TIMEOUT) + .autoStart(true) + .build(); + + private final HttpServer slackServer = http() + .server() + .port(SLACK_SERVER_PORT) + .timeout(SERVER_TIMEOUT) + .autoStart(true) + .build(); + + private final HttpServer petstoreServer = http() + .server() + .port(PETSTORE_SERVER_PORT) + .timeout(SERVER_TIMEOUT) .defaultStatus(HttpStatus.CREATED) - .timeout(60000L) + .autoStart(true) + .build(); + + private final HttpServer jiraServer = http() + .server() + .port(JIRA_SERVER_PORT) + .timeout(SERVER_TIMEOUT) .autoStart(true) .build(); @@ -40,12 +71,45 @@ public HttpServer httpServer() { return httpServer; } + @BindToRegistry + public HttpServer slackServer() { + return slackServer; + } + + @BindToRegistry + public HttpServer petstoreServer() { + return petstoreServer; + } + + @BindToRegistry + public HttpServer jiraServer() { + return jiraServer; + } + + @BindToRegistry + public SequenceBeforeTest beforeTest() { + return SequenceBeforeTest.Builder.beforeTest() + .actions( + // Set server ports as test variables + createVariables() + .variable("http.server.port", String.valueOf(HTTP_SERVER_PORT)) + .variable("slack.server.port", String.valueOf(SLACK_SERVER_PORT)) + .variable("petstore.server.port", String.valueOf(PETSTORE_SERVER_PORT)) + .variable("jira.server.port", String.valueOf(JIRA_SERVER_PORT)) + ) + .build(); + } + @BindToRegistry public SequenceAfterTest afterTest() { return SequenceAfterTest.Builder.afterTest() .actions( // Auto purge Http server endpoint - purgeEndpoints().endpoint(httpServer) + purgeEndpoints() + .endpoint(httpServer) + .endpoint(slackServer) + .endpoint(petstoreServer) + .endpoint(jiraServer) ) .build(); } diff --git a/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-to-http.it.yaml b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-to-http.it.yaml index ef5f90e7d..d467194cb 100644 --- a/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-to-http.it.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-to-http.it.yaml @@ -48,6 +48,9 @@ actions: file: "aws/s3/aws-s3-to-http.yaml" systemProperties: file: "aws/s3/application.properties" + properties: + - name: http.sink.url + value: "http://localhost:${http.server.port}/incoming" # Publish event - send: diff --git a/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-to-http.yaml b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-to-http.yaml index e40598800..70ddfcc21 100644 --- a/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-to-http.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/aws/s3/aws-s3-to-http.yaml @@ -76,4 +76,4 @@ spec: apiVersion: camel.apache.org/v1 name: http-sink properties: - url: http://localhost:8081/incoming + url: "{{http.sink.url}}" diff --git a/tests/camel-kamelets-itest/src/test/resources/earthquake/earthquake-to-http.it.yaml b/tests/camel-kamelets-itest/src/test/resources/earthquake/earthquake-to-http.it.yaml index f9b45d924..6198599e7 100644 --- a/tests/camel-kamelets-itest/src/test/resources/earthquake/earthquake-to-http.it.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/earthquake/earthquake-to-http.it.yaml @@ -23,6 +23,10 @@ actions: run: integration: file: "earthquake/earthquake-to-http.yaml" + systemProperties: + properties: + - name: http.sink.url + value: "http://localhost:${http.server.port}/test" # Verify Http request - http: diff --git a/tests/camel-kamelets-itest/src/test/resources/earthquake/earthquake-to-http.yaml b/tests/camel-kamelets-itest/src/test/resources/earthquake/earthquake-to-http.yaml index fd3d2925e..06a1dc00d 100644 --- a/tests/camel-kamelets-itest/src/test/resources/earthquake/earthquake-to-http.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/earthquake/earthquake-to-http.yaml @@ -26,4 +26,4 @@ spec: apiVersion: camel.apache.org/v1 name: earthquake-source sink: - uri: http://localhost:8081/test + uri: "{{http.sink.url}}" diff --git a/tests/camel-kamelets-itest/src/test/resources/jira/jira-add-comment-sink-pipe.it.yaml b/tests/camel-kamelets-itest/src/test/resources/jira/jira-add-comment-sink-pipe.it.yaml index 9041dee69..c029bfe6c 100644 --- a/tests/camel-kamelets-itest/src/test/resources/jira/jira-add-comment-sink-pipe.it.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/jira/jira-add-comment-sink-pipe.it.yaml @@ -19,8 +19,6 @@ name: jira-add-comment-sink-pipe-test variables: - name: "timer.source.period" value: "10000" - - name: "jira.url" - value: "http://localhost:8081" - name: "jira.project.key" value: "CAMEL" - name: "jira.issue.assignee" @@ -46,6 +44,10 @@ variables: - name: "jira.password" value: "secr3t" actions: + - createVariables: + variables: + - name: "jira.url" + value: "http://localhost:${jira.server.port}" # Create Camel JBang integration - camel: jbang: @@ -70,7 +72,7 @@ actions: # Verify get issue request - http: - server: "httpServer" + server: "jiraServer" receiveRequest: GET: path: "/rest/api/latest/issue/${jira.issue.key}" @@ -79,7 +81,7 @@ actions: value: "Basic citrus:encodeBase64(${jira.username}:${jira.password})" - http: - server: "httpServer" + server: "jiraServer" sendResponse: response: status: 200 @@ -126,7 +128,7 @@ actions: # Verify server info request - http: - server: "httpServer" + server: "jiraServer" receiveRequest: GET: path: "/rest/api/latest/serverInfo" @@ -135,7 +137,7 @@ actions: value: "Basic citrus:encodeBase64(${jira.username}:${jira.password})" - http: - server: "httpServer" + server: "jiraServer" sendResponse: response: status: 200 @@ -162,7 +164,7 @@ actions: # Verify add comment request - http: - server: "httpServer" + server: "jiraServer" receiveRequest: POST: path: "/rest/api/latest/issue/${jira.issue.key}/comment" @@ -176,7 +178,7 @@ actions: } - http: - server: "httpServer" + server: "jiraServer" sendResponse: response: status: 200 diff --git a/tests/camel-kamelets-itest/src/test/resources/jira/jira-add-issue-sink-pipe.it.yaml b/tests/camel-kamelets-itest/src/test/resources/jira/jira-add-issue-sink-pipe.it.yaml index 625442a65..e93bc2c7f 100644 --- a/tests/camel-kamelets-itest/src/test/resources/jira/jira-add-issue-sink-pipe.it.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/jira/jira-add-issue-sink-pipe.it.yaml @@ -19,8 +19,6 @@ name: jira-add-issue-sink-pipe-test variables: - name: "timer.source.period" value: "10000" - - name: "jira.url" - value: "http://localhost:8081" - name: "jira.project.key" value: "CAMEL" - name: "jira.issue.assignee" @@ -42,6 +40,10 @@ variables: - name: "jira.password" value: "secr3t" actions: + - createVariables: + variables: + - name: "jira.url" + value: "http://localhost:${jira.server.port}" # Create Camel JBang integration - camel: jbang: @@ -74,7 +76,7 @@ actions: # Verify issue type request - http: - server: "httpServer" + server: "jiraServer" receiveRequest: GET: path: "/rest/api/latest/issuetype" @@ -83,7 +85,7 @@ actions: value: "Basic citrus:encodeBase64(${jira.username}:${jira.password})" - http: - server: "httpServer" + server: "jiraServer" sendResponse: response: status: 200 @@ -115,7 +117,7 @@ actions: # Verify add issue request - http: - server: "httpServer" + server: "jiraServer" receiveRequest: POST: path: "/rest/api/latest/issue" @@ -142,7 +144,7 @@ actions: } - http: - server: "httpServer" + server: "jiraServer" sendResponse: response: status: 200 diff --git a/tests/camel-kamelets-itest/src/test/resources/jira/jira-source-pipe.it.yaml b/tests/camel-kamelets-itest/src/test/resources/jira/jira-source-pipe.it.yaml index 3cc4f4895..a8cecd814 100644 --- a/tests/camel-kamelets-itest/src/test/resources/jira/jira-source-pipe.it.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/jira/jira-source-pipe.it.yaml @@ -17,8 +17,6 @@ name: jira-source-pipe-test variables: - - name: "jira.url" - value: "http://localhost:8081" - name: "jira.project.id" value: "10001" - name: "jira.issue.id" @@ -34,6 +32,10 @@ variables: - name: "jira.jql" value: "assignee=citrus" actions: + - createVariables: + variables: + - name: "jira.url" + value: "http://localhost:${jira.server.port}" # Create Camel JBang integration - camel: jbang: @@ -54,7 +56,7 @@ actions: # Verify latest issue request - http: - server: "httpServer" + server: "jiraServer" receiveRequest: GET: path: "/rest/api/latest/search" @@ -68,7 +70,7 @@ actions: value: "Basic citrus:encodeBase64(${jira.username}:${jira.password})" - http: - server: "httpServer" + server: "jiraServer" sendResponse: response: status: 200 @@ -95,7 +97,7 @@ actions: # Verify search request - http: - server: "httpServer" + server: "jiraServer" receiveRequest: GET: path: "/rest/api/latest/search" @@ -111,7 +113,7 @@ actions: value: "Basic citrus:encodeBase64(${jira.username}:${jira.password})" - http: - server: "httpServer" + server: "jiraServer" sendResponse: response: status: 200 diff --git a/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-source-pipe.it.yaml b/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-source-pipe.it.yaml index 65afcdd6e..c1ec199fb 100644 --- a/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-source-pipe.it.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-source-pipe.it.yaml @@ -47,6 +47,9 @@ actions: file: "kafka/kafka-source-pipe.yaml" systemProperties: file: "kafka/application.properties" + properties: + - name: http.sink.url + value: "http://localhost:${http.server.port}/result" # Verify topic subscription - camel: diff --git a/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-source-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-source-pipe.yaml index 47b783e6c..97690177e 100644 --- a/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-source-pipe.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-source-pipe.yaml @@ -33,5 +33,5 @@ spec: securityProtocol: '{{kafka.securityProtocol}}' deserializeHeaders: '{{kafka.deserializeHeaders}}' sink: - uri: http://localhost:8081/result + uri: "{{http.sink.url}}" diff --git a/tests/camel-kamelets-itest/src/test/resources/openapi/rest-openapi-sink-add-pet.it.yaml b/tests/camel-kamelets-itest/src/test/resources/openapi/rest-openapi-sink-add-pet.it.yaml index b3363a68d..f51a20f65 100644 --- a/tests/camel-kamelets-itest/src/test/resources/openapi/rest-openapi-sink-add-pet.it.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/openapi/rest-openapi-sink-add-pet.it.yaml @@ -35,6 +35,8 @@ actions: file: "openapi/rest-openapi-sink-pipe.yaml" systemProperties: properties: + - name: "petstore.server.url" + value: "http://localhost:${petstore.server.port}" - name: "petId" value: "${petId}" - name: "pet" @@ -45,13 +47,13 @@ actions: # Verify OpenAPI spec request - http: - server: "httpServer" + server: "petstoreServer" receiveRequest: GET: path: "/petstore/openapi.json" - http: - server: "httpServer" + server: "petstoreServer" sendResponse: response: status: 200 @@ -63,7 +65,7 @@ actions: # Verify add pet request - http: - server: "httpServer" + server: "petstoreServer" receiveRequest: POST: path: "/petstore/pet" @@ -71,7 +73,7 @@ actions: data: "${pet}" - http: - server: "httpServer" + server: "petstoreServer" sendResponse: response: status: 201 diff --git a/tests/camel-kamelets-itest/src/test/resources/openapi/rest-openapi-sink-delete-pet.it.yaml b/tests/camel-kamelets-itest/src/test/resources/openapi/rest-openapi-sink-delete-pet.it.yaml index aab3f378c..706644bc2 100644 --- a/tests/camel-kamelets-itest/src/test/resources/openapi/rest-openapi-sink-delete-pet.it.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/openapi/rest-openapi-sink-delete-pet.it.yaml @@ -35,6 +35,8 @@ actions: file: "openapi/rest-openapi-sink-pipe.yaml" systemProperties: properties: + - name: "petstore.server.url" + value: "http://localhost:${petstore.server.port}" - name: "petId" value: "${petId}" - name: "pet" @@ -44,13 +46,13 @@ actions: # Verify OpenAPI spec request - http: - server: "httpServer" + server: "petstoreServer" receiveRequest: GET: path: "/petstore/openapi.json" - http: - server: "httpServer" + server: "petstoreServer" sendResponse: response: status: 200 @@ -62,13 +64,13 @@ actions: # Verify add pet request - http: - server: "httpServer" + server: "petstoreServer" receiveRequest: DELETE: path: "/petstore/pet/${petId}" - http: - server: "httpServer" + server: "petstoreServer" sendResponse: response: status: 204 diff --git a/tests/camel-kamelets-itest/src/test/resources/openapi/rest-openapi-sink-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/openapi/rest-openapi-sink-pipe.yaml index 0ac18c5d0..89fa21b86 100644 --- a/tests/camel-kamelets-itest/src/test/resources/openapi/rest-openapi-sink-pipe.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/openapi/rest-openapi-sink-pipe.yaml @@ -42,5 +42,5 @@ spec: apiVersion: camel.apache.org/v1 name: rest-openapi-sink properties: - specification: http://localhost:8081/petstore/openapi.json + specification: "{{petstore.server.url}}/petstore/openapi.json" operation: "{{spec.operation}}" diff --git a/tests/camel-kamelets-itest/src/test/resources/slack/application.properties b/tests/camel-kamelets-itest/src/test/resources/slack/application.properties index 7a07f37dc..60d706f23 100644 --- a/tests/camel-kamelets-itest/src/test/resources/slack/application.properties +++ b/tests/camel-kamelets-itest/src/test/resources/slack/application.properties @@ -15,6 +15,6 @@ # limitations under the License. # -slack.server.url=http://localhost:8081 +slack.server.url=http://localhost:${slack.server.port} slack.channel=${slack.channel} slack.token=${slack.token} diff --git a/tests/camel-kamelets-itest/src/test/resources/slack/slack-sink-pipe.it.yaml b/tests/camel-kamelets-itest/src/test/resources/slack/slack-sink-pipe.it.yaml index 1b1c259bc..3053449ca 100644 --- a/tests/camel-kamelets-itest/src/test/resources/slack/slack-sink-pipe.it.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/slack/slack-sink-pipe.it.yaml @@ -17,8 +17,6 @@ name: slack-sink-pipe-test variables: - - name: "slack.server.url" - value: "http://localhost:8081" - name: "slack.token" value: "xoxb-citrus:randomNumber(10)-citrus:randomNumber(13)-citrus:randomString(34)" - name: "slack.channel" @@ -32,6 +30,10 @@ variables: - name: "timer.source.period" value: "10000" actions: + - createVariables: + variables: + - name: "slack.server.url" + value: "http://localhost:${slack.server.port}" # Create Camel JBang integration - camel: jbang: @@ -49,7 +51,7 @@ actions: # Verify message post request - http: - server: "httpServer" + server: "slackServer" receiveRequest: POST: path: "/" @@ -62,7 +64,7 @@ actions: } - http: - server: "httpServer" + server: "slackServer" sendResponse: response: status: 200 diff --git a/tests/camel-kamelets-itest/src/test/resources/slack/slack-source-pipe.it.yaml b/tests/camel-kamelets-itest/src/test/resources/slack/slack-source-pipe.it.yaml index e1b42d007..a3a5ce907 100644 --- a/tests/camel-kamelets-itest/src/test/resources/slack/slack-source-pipe.it.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/slack/slack-source-pipe.it.yaml @@ -17,8 +17,6 @@ name: slack-source-pipe-test variables: - - name: "slack.server.url" - value: "http://localhost:8081" - name: "slack.token" value: "xoxb-citrus:randomNumber(10)-citrus:randomNumber(13)-citrus:randomString(34)" - name: "slack.channel" @@ -30,6 +28,10 @@ variables: - name: "slack.message" value: "Camel rocks!" actions: + - createVariables: + variables: + - name: "slack.server.url" + value: "http://localhost:${slack.server.port}" # Create Camel JBang integration - camel: jbang: @@ -45,7 +47,7 @@ actions: # Verify auth test request - http: - server: "httpServer" + server: "slackServer" receiveRequest: POST: path: "/api/auth.test" @@ -55,7 +57,7 @@ actions: value: "Bearer ${slack.token}" - http: - server: "httpServer" + server: "slackServer" sendResponse: response: status: 200 @@ -68,7 +70,7 @@ actions: # Verify conversations list request - http: - server: "httpServer" + server: "slackServer" receiveRequest: POST: path: "/api/conversations.list" @@ -78,7 +80,7 @@ actions: value: "Bearer ${slack.token}" - http: - server: "httpServer" + server: "slackServer" sendResponse: response: status: 200 @@ -91,7 +93,7 @@ actions: # Verify conversations history request - http: - server: "httpServer" + server: "slackServer" receiveRequest: POST: path: "/api/conversations.history" @@ -101,7 +103,7 @@ actions: value: "Bearer ${slack.token}" - http: - server: "httpServer" + server: "slackServer" sendResponse: response: status: 200 diff --git a/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http-pipe.it.yaml b/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http-pipe.it.yaml index 41816072d..03a622cfb 100644 --- a/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http-pipe.it.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http-pipe.it.yaml @@ -17,11 +17,13 @@ name: timer-to-http-pipe-test variables: - - name: "server.url" - value: "http://localhost:8081" - name: "timer.message" value: "Camel rocks!" actions: + - createVariables: + variables: + - name: "http.server.url" + value: "http://localhost:${http.server.port}" # Create Camel JBang integration - camel: jbang: @@ -31,8 +33,8 @@ actions: file: "timer/timer-to-http-pipe.yaml" systemProperties: properties: - - name: "server.url" - value: "${server.url}" + - name: "http.sink.url" + value: "${http.server.url}" - name: "timer.message" value: "${timer.message}" diff --git a/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http-pipe.yaml index ed715976d..a8ba3c74a 100644 --- a/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http-pipe.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http-pipe.yaml @@ -29,4 +29,4 @@ spec: period: 10000 message: "{{timer.message}}" sink: - uri: "{{server.url}}/events" + uri: "{{http.sink.url}}/events" diff --git a/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http.it.yaml b/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http.it.yaml index 4f4753e3f..cfbc53c57 100644 --- a/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http.it.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http.it.yaml @@ -17,11 +17,13 @@ name: timer-to-http-test variables: - - name: "server.url" - value: "http://localhost:8081" - name: "timer.message" value: "Camel rocks!" actions: + - createVariables: + variables: + - name: "http.server.url" + value: "http://localhost:${http.server.port}" # Create Camel JBang integration - camel: jbang: @@ -31,8 +33,8 @@ actions: file: "timer/timer-to-http.yaml" systemProperties: properties: - - name: "server.url" - value: "${server.url}" + - name: "http.sink.url" + value: "${http.server.url}" - name: "timer.message" value: "${timer.message}" diff --git a/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http.yaml b/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http.yaml index 0aedbc63e..eae58e10b 100644 --- a/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/timer/timer-to-http.yaml @@ -28,7 +28,7 @@ expression: constant: '{{timer.message}}' - to: - uri: '{{server.url}}/events' + uri: '{{http.sink.url}}/events' - to: uri: 'log:info' parameters: diff --git a/tests/camel-kamelets-itest/src/test/resources/transformation/data-type-action-pipe.it.yaml b/tests/camel-kamelets-itest/src/test/resources/transformation/data-type-action-pipe.it.yaml index f7d67927c..8b926203b 100644 --- a/tests/camel-kamelets-itest/src/test/resources/transformation/data-type-action-pipe.it.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/transformation/data-type-action-pipe.it.yaml @@ -17,11 +17,13 @@ name: data-type-action-pipe-test variables: - - name: "server.url" - value: "http://localhost:8081" - name: "uuid" value: "citrus:randomUUID()" actions: + - createVariables: + variables: + - name: "http.server.url" + value: "http://localhost:${http.server.port}" # Create Camel JBang integration - camel: jbang: @@ -31,8 +33,8 @@ actions: file: "transformation/data-type-action-pipe.yaml" systemProperties: properties: - - name: "server.url" - value: "${server.url}" + - name: "http.sink.url" + value: "${http.server.url}" - name: "input" value: | { \"id\": \"${uuid}\" } diff --git a/tests/camel-kamelets-itest/src/test/resources/transformation/data-type-action-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/transformation/data-type-action-pipe.yaml index 5e217c914..71f4a19b9 100644 --- a/tests/camel-kamelets-itest/src/test/resources/transformation/data-type-action-pipe.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/transformation/data-type-action-pipe.yaml @@ -48,4 +48,4 @@ spec: properties: showHeaders: true sink: - uri: "{{server.url}}/result" + uri: "{{http.sink.url}}/result" diff --git a/tests/camel-kamelets-itest/src/test/resources/transformation/extract-field-action-pipe.it.yaml b/tests/camel-kamelets-itest/src/test/resources/transformation/extract-field-action-pipe.it.yaml index 707058938..a442265d6 100644 --- a/tests/camel-kamelets-itest/src/test/resources/transformation/extract-field-action-pipe.it.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/transformation/extract-field-action-pipe.it.yaml @@ -17,13 +17,15 @@ name: extract-field-action-pipe-test variables: - - name: "server.url" - value: "http://localhost:8081" - name: "field.name" value: "subject" - name: "field.value" value: "Camel rocks!" actions: + - createVariables: + variables: + - name: "http.server.url" + value: "http://localhost:${http.server.port}" # Create Camel JBang integration - camel: jbang: @@ -33,8 +35,8 @@ actions: file: "transformation/extract-field-action-pipe.yaml" systemProperties: properties: - - name: "server.url" - value: "${server.url}" + - name: "http.sink.url" + value: "${http.server.url}" - name: "field.name" value: "${field.name}" - name: "input" diff --git a/tests/camel-kamelets-itest/src/test/resources/transformation/extract-field-action-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/transformation/extract-field-action-pipe.yaml index 42cf8c7a8..9e994901d 100644 --- a/tests/camel-kamelets-itest/src/test/resources/transformation/extract-field-action-pipe.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/transformation/extract-field-action-pipe.yaml @@ -38,4 +38,4 @@ spec: properties: field: "{{field.name}}" sink: - uri: "{{server.url}}/result" + uri: "{{http.sink.url}}/result" diff --git a/tests/camel-kamelets-itest/src/test/resources/transformation/insert-field-action-pipe.it.yaml b/tests/camel-kamelets-itest/src/test/resources/transformation/insert-field-action-pipe.it.yaml index 9fb0c6779..0ae464c4a 100644 --- a/tests/camel-kamelets-itest/src/test/resources/transformation/insert-field-action-pipe.it.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/transformation/insert-field-action-pipe.it.yaml @@ -17,8 +17,6 @@ name: insert-field-action-pipe-test variables: - - name: "server.url" - value: "http://localhost:8081" - name: "id" value: "citrus:randomUUID()" - name: "field.value" @@ -26,6 +24,10 @@ variables: - name: "field.name" value: "subject" actions: + - createVariables: + variables: + - name: "http.server.url" + value: "http://localhost:${http.server.port}" # Create Camel JBang integration - camel: jbang: @@ -35,8 +37,8 @@ actions: file: "transformation/insert-field-action-pipe.yaml" systemProperties: properties: - - name: "server.url" - value: "${server.url}" + - name: "http.sink.url" + value: "${http.server.url}" - name: "field.name" value: "${field.name}" - name: "field.value" diff --git a/tests/camel-kamelets-itest/src/test/resources/transformation/insert-field-action-pipe.yaml b/tests/camel-kamelets-itest/src/test/resources/transformation/insert-field-action-pipe.yaml index 5a29a8699..a52700de6 100644 --- a/tests/camel-kamelets-itest/src/test/resources/transformation/insert-field-action-pipe.yaml +++ b/tests/camel-kamelets-itest/src/test/resources/transformation/insert-field-action-pipe.yaml @@ -39,4 +39,4 @@ spec: field: "{{field.name}}" value: "{{field.value}}" sink: - uri: "{{server.url}}/result" + uri: "{{http.sink.url}}/result"