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

apupier 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 75e3ddc306a4 chore: camel-jbang: fix CatalogLookupsTest after 
ibm-watsonx-ai declared CamelAwsS3Key
75e3ddc306a4 is described below

commit 75e3ddc306a427092e04df62a4217306c380421f
Author: AurĂ©lien Pupier <[email protected]>
AuthorDate: Wed Dec 2 19:01:52 2026 +0100

    chore: camel-jbang: fix CatalogLookupsTest after ibm-watsonx-ai declared 
CamelAwsS3Key
    
    8e2e12160c23 (#31217, "declare the message headers of AI, Spring, Azure,
    salesforce and more components") made camel-ibm-watsonx-ai declare the
    CamelAwsS3Key header in the catalog (WatsonxAiConstants#AWS_S3_KEY): the
    upload operations take the document name from it.
    
    camel_catalog_find and camel_catalog_doc list every component that has a
    header, so CamelAwsS3Key is now a header of aws2-s3 and ibm-watsonx-ai,
    and CatalogLookupsTest, which expected aws2-s3 only, failed in
    findFindsAHeaderByItsNameOrConstant and
    aFilterThatMatchesNothingSaysWhereAnOptionOfThatNameIs.
    
    The lookup is right; the tests assumed the catalog at the time they were
    written. They now expect aws2-s3 among the components, and the "elsewhere"
    message to start with "message header of aws2-s3".
    
    Co-authored-by: IBM Bob
---
 .../apache/camel/dsl/jbang/core/commands/ai/CatalogLookupsTest.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/CatalogLookupsTest.java
 
b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/CatalogLookupsTest.java
index d6b6d34af55f..f335c81e9050 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/CatalogLookupsTest.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/CatalogLookupsTest.java
@@ -105,7 +105,8 @@ class CatalogLookupsTest {
             JsonObject header = first(result, "matches");
             assertThat(header.getString("kind")).isEqualTo("header");
             assertThat(header.getString("name")).isEqualTo("CamelAwsS3Key");
-            assertThat(strings(header, 
"components")).containsExactly("aws2-s3");
+            // other components read it too (ibm-watsonx-ai takes the name of 
a document from it)
+            assertThat(strings(header, "components")).contains("aws2-s3");
             assertThat(header.getString("constantName"))
                     
.isEqualTo("org.apache.camel.component.aws2.s3.AWS2S3Constants#KEY");
             
assertThat(result.getString("message")).contains("${header.CamelAwsS3Key}");
@@ -157,7 +158,7 @@ class CatalogLookupsTest {
                                                          + " 
optionsFilter=forcePathStyle shows it");
         // a message header of another component
         JsonObject header = catalogDoc(Map.of("name", "aws2-sqs", 
"optionsFilter", "CamelAwsS3Key"));
-        assertThat(header.getString("elsewhere")).startsWith("CamelAwsS3Key is 
a message header of aws2-s3:");
+        assertThat(header.getString("elsewhere")).startsWith("CamelAwsS3Key is 
a message header of aws2-s3");
 
         // an EIP and a language say it too
         JsonObject eip = catalogDoc(Map.of("name", "restConfiguration", 
"kind", "eip", "optionsFilter", "componentName"));

Reply via email to