This is an automated email from the ASF dual-hosted git repository.
davsclaus 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 65c04d2c53ac CAMEL-26526: camel-jbang - fix LocalKameletsITCase to use
a consumer route with --local-kamelet-dir (#29159)
65c04d2c53ac is described below
commit 65c04d2c53ac302c210dec3090b2815d1e898112
Author: Guillaume Nodet <[email protected]>
AuthorDate: Wed Nov 4 19:52:52 2026 +0100
CAMEL-26526: camel-jbang - fix LocalKameletsITCase to use a consumer route
with --local-kamelet-dir (#29159)
LocalKameletsITCase ran a bare user-source.kamelet.yaml, which only
registers a route template, so since CAMEL-25397 the run exits with "No routes
found". The test now runs a consumer route (from: kamelet:user-source) with
--local-kamelet-dir, which exercises the flag end to end. Running a lone
kamelet file still exits 1.
AI-generated by Hermes Agent on behalf of Guillaume Nodet.
---
.../camel/dsl/jbang/it/LocalKameletsITCase.java | 7 ++++--
.../dsl/jbang/it/support/JBangTestSupport.java | 1 +
.../jbang/it/user-source-consumer.camel.yaml | 25 ++++++++++++++++++++++
.../camel/dsl/jbang/run/JBangRunnerTest.java | 1 -
4 files changed, 31 insertions(+), 3 deletions(-)
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 6da58274f0ab..f065fb941fd7 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
@@ -24,9 +24,12 @@ import org.junit.jupiter.api.Test;
public class LocalKameletsITCase extends JBangTestSupport {
@Test
public void localKameletRunTest() throws IOException {
+ // Copy the kamelet definition and the consumer route to the data
folder
copyResourceInDataFolder(TestResources.USER_SOURCE_KAMELET);
+ copyResourceInDataFolder(TestResources.USER_SOURCE_CONSUMER);
+ // Run the consumer route, telling Camel where to find the local
kamelet
executeBackground(
- String.format("run --local-kamelet-dir=%s
%s/user-source.kamelet.yaml", mountPoint(), mountPoint()));
- checkLogContains("Apache Camel " + version() + " (user-source)
started");
+ String.format("run --local-kamelet-dir=%s
%s/user-source-consumer.camel.yaml", mountPoint(), mountPoint()));
+ checkLogContains("Apache Camel " + version() + "
(user-source-consumer) started");
}
}
diff --git
a/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/support/JBangTestSupport.java
b/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/support/JBangTestSupport.java
index 4c5b671430b7..0f155044ebf1 100644
---
a/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/support/JBangTestSupport.java
+++
b/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/support/JBangTestSupport.java
@@ -150,6 +150,7 @@ public abstract class JBangTestSupport {
STUB_ROUTE("StubRoute.java", "/jbang/it/StubRoute.java"),
HISTORY_ROUTE("HistoryRoute.java", "/jbang/it/HistoryRoute.java"),
USER_SOURCE_KAMELET("user-source.kamelet.yaml",
"/jbang/it/user-source.kamelet.yaml"),
+ USER_SOURCE_CONSUMER("user-source-consumer.camel.yaml",
"/jbang/it/user-source-consumer.camel.yaml"),
GROUP_ROUTE("GroupRoute.java", "/jbang/it/GroupRoute.java");
private String name;
diff --git
a/dsl/camel-jbang/camel-jbang-it/src/test/resources/jbang/it/user-source-consumer.camel.yaml
b/dsl/camel-jbang/camel-jbang-it/src/test/resources/jbang/it/user-source-consumer.camel.yaml
new file mode 100644
index 000000000000..936aa191c41d
--- /dev/null
+++
b/dsl/camel-jbang/camel-jbang-it/src/test/resources/jbang/it/user-source-consumer.camel.yaml
@@ -0,0 +1,25 @@
+#
+# 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.
+#
+
+# A simple route that consumes from the local user-source kamelet.
+# Used by LocalKameletsITCase to verify that --local-kamelet-dir is honoured.
+- from:
+ uri: "kamelet:user-source"
+ parameters:
+ period: "2000"
+ steps:
+ - log: "${body}"
diff --git
a/dsl/camel-jbang/camel-jbang-run/src/test/java/org/apache/camel/dsl/jbang/run/JBangRunnerTest.java
b/dsl/camel-jbang/camel-jbang-run/src/test/java/org/apache/camel/dsl/jbang/run/JBangRunnerTest.java
index b6dbfea713fc..24560881b822 100644
---
a/dsl/camel-jbang/camel-jbang-run/src/test/java/org/apache/camel/dsl/jbang/run/JBangRunnerTest.java
+++
b/dsl/camel-jbang/camel-jbang-run/src/test/java/org/apache/camel/dsl/jbang/run/JBangRunnerTest.java
@@ -237,7 +237,6 @@ class JBangRunnerTest {
void routesAreExpectedUnlessFilesCanBeAddedOrNoneAreWanted() {
KameletMain main = mock(KameletMain.class);
when(main.getCamelContext()).thenReturn(new DefaultCamelContext());
-
assertThat(integration(main, new RunRequest()).hasNoRoutes()).isTrue();
// files can be added or changed later
RunRequest dev = new RunRequest();