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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]