You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "apupier (via GitHub)" <gi...@apache.org> on 2026/09/09 09:13:48 UTC

[PR] Fix CamelConfigITCase.testCamelListConfig [camel]

apupier opened a new pull request, #26229:
URL: https://github.com/apache/camel/pull/26229

   The order of config in the output is not important, check only if they are all there
   
   it avoids this error:
   ```
   [command  camel config list should output gav =
   com.foo:acme:1.0-SNAPSHOT
   runtime = quarkus
   directory = /deployments/data/84965e9286b07]
   Expecting actual:
     "----- Global -----
   gav = com.foo:acme:1.0-SNAPSHOT
   directory = /deployments/data/84965e9286b07
   runtime = quarkus
   "
   to contain:
     "gav = com.foo:acme:1.0-SNAPSHOT
   runtime = quarkus
   directory = /deployments/data/84965e9286b07"
   ```
   
   # Description
   
   <!--
   - Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   -->
   
   # Target
   
   - [ ] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch)
   
   # Tracking
   - [ ] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).
   
   <!--
   # *Note*: trivial changes like, typos, minor documentation fixes and other small items do not require a JIRA issue. In this case your pull request should address just this issue, without pulling in other changes.
   -->
   
   # Apache Camel coding standards and style
   
   - [ ] I checked that each commit in the pull request has a meaningful subject line and body.
   
   <!--
   If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
   -->
   
   - [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes.
   
   <!--
   You can run the aforementioned command in your module so that the build auto-formats your code. This will also be verified as part of the checks and your PR may be rejected if if there are uncommited changes after running `mvn clean install -DskipTests`.
   
   You can learn more about the contribution guidelines at https://github.com/apache/camel/blob/main/CONTRIBUTING.md
   -->
   
   # AI-assisted contributions
   
   - [ ] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix CamelConfigITCase.testCamelListConfig [camel]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #26229:
URL: https://github.com/apache/camel/pull/26229#discussion_r3968157462


##########
dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/CamelConfigITCase.java:
##########
@@ -37,9 +37,10 @@ public void testCamelListConfig() {
         execute("config set runtime=quarkus");
         execute("config set directory=" + mountPoint());
         checkCommandOutputs("config list",
-                "gav = com.foo:acme:1.0-SNAPSHOT\n" +
-                                           "runtime = quarkus\n" +
-                                           "directory = " + mountPoint());
+                new String[] {
+                        "gav = com.foo:acme:1.0-SNAPSHOT",
+                        "runtime = quarkus",
+                        "directory = " + mountPoint() });

Review Comment:
   ⚠️ **Compilation error**: `checkCommandOutputs(String, String)` does not have an overload accepting `String[]`. This code won't compile.
   
   Since the existing `checkCommandOutputs` only takes a single `String`, you'll need to either add a varargs overload in `JBangTestSupport` or check each line individually.
   
   Suggested varargs overload for `JBangTestSupport`:
   ```java
   protected void checkCommandOutputs(String command, String... contains) {
       String output = execute(command);
       for (String c : contains) {
           Assertions.assertThat(output)
                   .as("command " + getMainCommand() + " " + command + " should output " + c)
                   .contains(c);
       }
   }
   ```
   Note: changing the existing `(String, String)` signature to `(String, String...)` is source-compatible — all existing callers pass a single string which matches the varargs.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix CamelConfigITCase.testCamelListConfig [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #26229:
URL: https://github.com/apache/camel/pull/26229#issuecomment-5619476812

   have fixed this on main branch


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix CamelConfigITCase.testCamelListConfig [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26229:
URL: https://github.com/apache/camel/pull/26229#issuecomment-5601529838

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `dsl/camel-jbang/camel-jbang-it`
   
   ---
   
   <details><summary>:microscope: Scalpel shadow comparison — Scalpel: 1 tested, 0 compile-only — current: 0 all tested</summary>
   
   [Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **1 affected modules** (current approach: 0).
   
   <details><summary>:warning: Modules only in Scalpel (1)</summary>
   
   - `camel-jbang-it`
   
   </details>
   
   **Skip-tests mode would test 1 modules** (1 direct + 0 downstream), **skip tests for 0** (generated code, meta-modules)
   
   <details><summary>Modules Scalpel would test (1)</summary>
   
   - `camel-jbang-it`
   
   </details>
   
   > :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
   
   </details>
   
   :warning: **Some tests are disabled on GitHub Actions** (`@DisabledIfSystemProperty(named = "ci.env.name")`) and require manual verification:
   
   - `dsl/camel-jbang/camel-jbang-it`: 1 test(s) disabled on GitHub Actions
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/34333707509)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix CamelConfigITCase.testCamelListConfig [camel]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #26229:
URL: https://github.com/apache/camel/pull/26229#discussion_r3971514627


##########
dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/support/JBangTestSupport.java:
##########
@@ -215,6 +215,12 @@ protected void checkCommandOutputs(String command, String contains) {
                 .contains(contains);
     }
 
+    protected void checkCommandOutputs(String command, String... contains) {
+        Assertions.assertThat(execute(command))
+                .as("command  " + getMainCommand() + " " + command + " should output each of these lines " + contains)

Review Comment:
   Two nits:
   1. `+ contains` → `+ java.util.Arrays.toString(contains)` (otherwise this prints `[Ljava.lang.String;@hash`)
   2. Double space: `"command  "` → `"command "`
   
   ```suggestion
       protected void checkCommandOutputs(String command, String... contains) {
           Assertions.assertThat(execute(command))
                   .as("command " + getMainCommand() + " " + command + " should output each of these lines " + java.util.Arrays.toString(contains))
                   .contains(contains);
       }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix CamelConfigITCase.testCamelListConfig [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26229:
URL: https://github.com/apache/camel/pull/26229#issuecomment-5599575886

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix CamelConfigITCase.testCamelListConfig [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus closed pull request #26229: Fix CamelConfigITCase.testCamelListConfig
URL: https://github.com/apache/camel/pull/26229


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org