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

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


The following commit(s) were added to refs/heads/main by this push:
     new ecb49f296a47 ci: camel-jbang-it - fix ExportITCase.testExportFile and 
LocalKameletsITCase.localKameletRunTest
ecb49f296a47 is described below

commit ecb49f296a4798e7fc69a217f39f2f22c8cbef73
Author: croway <[email protected]>
AuthorDate: Sat Nov 21 14:22:58 2026 +0100

    ci: camel-jbang-it - fix ExportITCase.testExportFile and 
LocalKameletsITCase.localKameletRunTest
    
    Both tests fail on every run of the Camel Jbang IT Tests job.
    
    ExportITCase.testExportFile exported to the directory of its source files
    from another directory. Since CAMEL-26912 camel export refuses a directory
    with files that no export created, so the test now exports to a new
    sub-directory.
    
    LocalKameletsITCase.localKameletRunTest runs a kamelet that called
    random-data-api.com, a host that no longer resolves: the route logged an
    ERROR, which fails the test. The kamelet now sets a fixed body, and the
    test also checks that the consumer route logs it.
---
 .../src/test/java/org/apache/camel/dsl/jbang/it/ExportITCase.java  | 7 ++++---
 .../java/org/apache/camel/dsl/jbang/it/LocalKameletsITCase.java    | 2 ++
 .../src/test/resources/jbang/it/user-source.kamelet.yaml           | 5 +++--
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git 
a/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/ExportITCase.java
 
b/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/ExportITCase.java
index 494125890714..1c488cac8824 100644
--- 
a/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/ExportITCase.java
+++ 
b/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/ExportITCase.java
@@ -64,11 +64,12 @@ public class ExportITCase extends JBangTestSupport {
     public void testExportFile() throws IOException {
         copyResourceInDataFolder(TestResources.DIR_ROUTE);
         copyResourceInDataFolder(TestResources.SERVER_ROUTE);
+        // export to a new directory: the one of the source files has files 
that no export created (CAMEL-26912)
         execute(String.format(
-                "export %s/FromDirectoryRoute.java %s/server.yaml 
--runtime=spring-boot --gav=com.foo:acme:1.0-SNAPSHOT --directory=%s",
+                "export %s/FromDirectoryRoute.java %s/server.yaml 
--runtime=spring-boot --gav=com.foo:acme:1.0-SNAPSHOT --directory=%s/exported",
                 mountPoint(), mountPoint(), mountPoint()));
-        
assertFileInDataFolderExists("src/main/java/com/foo/acme/FromDirectoryRoute.java");
-        assertFileInDataFolderExists("src/main/resources/camel/server.yaml");
+        
assertFileInDataFolderExists("exported/src/main/java/com/foo/acme/FromDirectoryRoute.java");
+        
assertFileInDataFolderExists("exported/src/main/resources/camel/server.yaml");
     }
 
     @Test
diff --git 
a/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/LocalKameletsITCase.java
 
b/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/LocalKameletsITCase.java
index f065fb941fd7..7b9eeaee3565 100644
--- 
a/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/LocalKameletsITCase.java
+++ 
b/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/LocalKameletsITCase.java
@@ -31,5 +31,7 @@ public class LocalKameletsITCase extends JBangTestSupport {
         executeBackground(
                 String.format("run --local-kamelet-dir=%s 
%s/user-source-consumer.camel.yaml", mountPoint(), mountPoint()));
         checkLogContains("Apache Camel " + version() + " 
(user-source-consumer) started");
+        // The consumer route logs the body that the local kamelet produces
+        checkLogContains("{\"id\": 1, \"first_name\": \"Camel\", 
\"last_name\": \"Rider\"}");
     }
 }
diff --git 
a/dsl/camel-jbang/camel-jbang-it/src/test/resources/jbang/it/user-source.kamelet.yaml
 
b/dsl/camel-jbang/camel-jbang-it/src/test/resources/jbang/it/user-source.kamelet.yaml
index 6517e822d687..742e8b7635eb 100644
--- 
a/dsl/camel-jbang/camel-jbang-it/src/test/resources/jbang/it/user-source.kamelet.yaml
+++ 
b/dsl/camel-jbang/camel-jbang-it/src/test/resources/jbang/it/user-source.kamelet.yaml
@@ -43,7 +43,6 @@ spec:
       mediaType: application/json
   dependencies:
     - "camel:timer"
-    - "camel:http"
     - "camel:kamelet"
   template:
     from:
@@ -51,5 +50,7 @@ spec:
       parameters:
         period: "{{period}}"
       steps:
-        - to: https://random-data-api.com/api/v2/users
+        # a fixed body, so the test does not depend on an external host
+        - setBody:
+            constant: '{"id": 1, "first_name": "Camel", "last_name": "Rider"}'
         - to: "kamelet:sink"

Reply via email to