This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch fix/CAMEL-24810 in repository https://gitbox.apache.org/repos/asf/camel.git
commit 07362236bd5f057ca221564710ae0e557aacdc4b Author: Claus Ibsen <[email protected]> AuthorDate: Fri Sep 18 13:00:05 2026 +0200 chore: camel-jbang - review fixes: the unknown-library test uses a package no mapping names, and the classNotFound Javadoc is back on its method com.zaxxer.hikari becomes a mapped package with CAMEL-24809, so the test that expects the "declare the dependency" hint now uses com.example.pool, which nothing will ever map. The Javadoc of classNotFound had ended up above the new knownDependencies field; it is back on the method and names the third case, a class camel run downloads. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj --- .../apache/camel/dsl/jbang/core/commands/ai/BeanRefChecks.java | 9 +++++---- .../dsl/jbang/core/commands/ai/SourceValidatorBeanRefsTest.java | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/BeanRefChecks.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/BeanRefChecks.java index 548655bee85a..d20270a3f34a 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/BeanRefChecks.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/BeanRefChecks.java @@ -341,10 +341,6 @@ final class BeanRefChecks { return n; } - /** - * A class named with its package that is neither next to the route nor on the CLI classpath: the wrong package - * (org.apache.camel.support.StringAggregationStrategy) or a missing dependency. Null when the class is fine. - */ /** * The classes camel run resolves to a Maven dependency and downloads on demand (camel-kamelet-main's * camel-main-known-dependencies.properties, camel-component-known-dependencies.properties and the generated @@ -387,6 +383,11 @@ final class BeanRefChecks { return gav; } + /** + * A class named with its package that is neither next to the route, nor on the CLI classpath, nor one camel run + * downloads: the wrong package (org.apache.camel.support.StringAggregationStrategy) or a missing dependency. Null + * when the class is fine. + */ static String classNotFound(String fqcn, BeanDeclarations external) { if (external == null || external == BeanDeclarations.NONE || fqcn == null || fqcn.contains("{{") || fqcn.contains("${")) { diff --git a/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/SourceValidatorBeanRefsTest.java b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/SourceValidatorBeanRefsTest.java index b2903c9a754e..d9994e238ee2 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/SourceValidatorBeanRefsTest.java +++ b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/SourceValidatorBeanRefsTest.java @@ -378,10 +378,11 @@ public class SourceValidatorBeanRefsTest { @Test void aClassFromAnUnknownLibrarySaysHowToDeclareTheDependency(@TempDir Path dir) throws IOException { + // a package no mapping will ever name: com.zaxxer.hikari is mapped as a package by CAMEL-24809 List<String> msgs = SourceValidator.validate("r.camel.yaml", """ - beans: - name: pool - type: "#class:com.zaxxer.hikari.HikariDataSourceX" + type: "#class:com.example.pool.HikariDataSourceX" """, CATALOG, null, dir); assertThat(msgs).hasSize(1); assertThat(msgs.get(0)).contains("was not found").contains("camel.jbang.dependencies=<groupId>:<artifactId>:<version>");
