This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


The following commit(s) were added to refs/heads/main by this push:
     new bd74f5a9 chore: Improve integration tests (#2370)
bd74f5a9 is described below

commit bd74f5a90bb40220816e13bb3c06111499ddef63
Author: Christoph Deppisch <[email protected]>
AuthorDate: Wed Jan 29 12:15:53 2025 +0100

    chore: Improve integration tests (#2370)
    
    * chore: Remove obsolete workaround
    
    * 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
---
 .../src/test/java/EndpointAutoConfiguration.java   | 73 ++++++++++++++++++++--
 .../test/resources/aws/s3/aws-s3-to-http.it.yaml   |  3 +
 .../src/test/resources/aws/s3/aws-s3-to-http.yaml  |  2 +-
 .../test/resources/citrus-application.properties   |  3 -
 .../earthquake/earthquake-to-http.it.yaml          |  4 ++
 .../resources/earthquake/earthquake-to-http.yaml   |  2 +-
 .../jira/jira-add-comment-sink-pipe.it.yaml        | 18 +++---
 .../jira/jira-add-issue-sink-pipe.it.yaml          | 14 +++--
 .../test/resources/jira/jira-source-pipe.it.yaml   | 14 +++--
 .../test/resources/kafka/kafka-source-pipe.it.yaml |  3 +
 .../test/resources/kafka/kafka-source-pipe.yaml    |  2 +-
 .../openapi/rest-openapi-sink-add-pet.it.yaml      | 10 +--
 .../openapi/rest-openapi-sink-delete-pet.it.yaml   | 10 +--
 .../resources/openapi/rest-openapi-sink-pipe.yaml  |  2 +-
 .../test/resources/slack/application.properties    |  2 +-
 .../test/resources/slack/slack-sink-pipe.it.yaml   | 10 +--
 .../test/resources/slack/slack-source-pipe.it.yaml | 18 +++---
 .../resources/timer/timer-to-http-pipe.it.yaml     | 10 +--
 .../test/resources/timer/timer-to-http-pipe.yaml   |  2 +-
 .../src/test/resources/timer/timer-to-http.it.yaml | 10 +--
 .../src/test/resources/timer/timer-to-http.yaml    |  2 +-
 .../transformation/data-type-action-pipe.it.yaml   | 10 +--
 .../transformation/data-type-action-pipe.yaml      |  2 +-
 .../extract-field-action-pipe.it.yaml              | 10 +--
 .../transformation/extract-field-action-pipe.yaml  |  2 +-
 .../insert-field-action-pipe.it.yaml               | 10 +--
 .../transformation/insert-field-action-pipe.yaml   |  2 +-
 27 files changed, 171 insertions(+), 79 deletions(-)

diff --git 
a/tests/camel-kamelets-itest/src/test/java/EndpointAutoConfiguration.java 
b/tests/camel-kamelets-itest/src/test/java/EndpointAutoConfiguration.java
index 7eac291a..87c93305 100644
--- a/tests/camel-kamelets-itest/src/test/java/EndpointAutoConfiguration.java
+++ b/tests/camel-kamelets-itest/src/test/java/EndpointAutoConfiguration.java
@@ -17,22 +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;
-import static org.citrusframework.jbang.actions.JBangAction.Builder.jbang;
 
 @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();
 
@@ -41,14 +71,45 @@ public class EndpointAutoConfiguration {
         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(
-                    // Workaround to stop all Camel JBang integrations after 
test - remove when Citrus 4.5.2 is released
-                    jbang().app("camel@apache/camel").command("stop"),
                     // 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 ef5f90e7..d467194c 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 e4059880..70ddfcc2 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/citrus-application.properties 
b/tests/camel-kamelets-itest/src/test/resources/citrus-application.properties
index 2e723804..63df8a9c 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources/citrus-application.properties
+++ 
b/tests/camel-kamelets-itest/src/test/resources/citrus-application.properties
@@ -21,9 +21,6 @@ citrus.camel.jbang.kamelets.local.dir=../../../kamelets
 # Enable dump of Camel JBang integration output
 citrus.camel.jbang.dump.integration.output=true
 
-# Workaround to stop all Camel JBang integrations after test - remove when 
Citrus 4.5.2 is released
-citrus.camel.jbang.auto.remove.resources=false
-
 # Use general registry mirror for Docker images (e.g. Testcontainers)
 citrus.testcontainers.registry.mirror=mirror.gcr.io
 citrus.testcontainers.registry.mirror.enabled=true
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 f9b45d92..6198599e 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 fd3d2925..06a1dc00 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 9041dee6..c029bfe6 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 625442a6..e93bc2c7 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 3cc4f489..a8cecd81 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 65afcdd6..c1ec199f 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 47b783e6..97690177 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 b3363a68..f51a20f6 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 aab3f378..706644bc 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 0ac18c5d..89fa21b8 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 7a07f37d..60d706f2 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 1b1c259b..3053449c 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 e1b42d00..a3a5ce90 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 41816072..03a622cf 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 ed715976..a8ba3c74 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 4f4753e3..cfbc53c5 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 0aedbc63..eae58e10 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 f7d67927..8b926203 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 5e217c91..71f4a19b 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 70705893..a442265d 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 42cf8c7a..9e994901 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 9fb0c677..0ae464c4 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 5a29a869..a52700de 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"

Reply via email to