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 e22c48a80527 CAMEL-23881: Fix escaped Maven property reference in
TestPluginExporter (#24385)
e22c48a80527 is described below
commit e22c48a805272d4075c83027322eaf9ba8e40cd5
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Jul 2 17:59:57 2026 +0200
CAMEL-23881: Fix escaped Maven property reference in TestPluginExporter
(#24385)
Signed-off-by: Claus Ibsen <[email protected]>
Co-authored-by: Claude <[email protected]>
---
.../core/commands/test/TestPluginExporter.java | 2 +-
.../jbang/core/commands/test/TestPluginTest.java | 23 ++++++++++++++++++++++
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git
a/dsl/camel-jbang/camel-jbang-plugin-test/src/main/java/org/apache/camel/dsl/jbang/core/commands/test/TestPluginExporter.java
b/dsl/camel-jbang/camel-jbang-plugin-test/src/main/java/org/apache/camel/dsl/jbang/core/commands/test/TestPluginExporter.java
index 4ffb3ee4ecb1..c20a1a59bfeb 100644
---
a/dsl/camel-jbang/camel-jbang-plugin-test/src/main/java/org/apache/camel/dsl/jbang/core/commands/test/TestPluginExporter.java
+++
b/dsl/camel-jbang/camel-jbang-plugin-test/src/main/java/org/apache/camel/dsl/jbang/core/commands/test/TestPluginExporter.java
@@ -238,6 +238,6 @@ public class TestPluginExporter implements PluginExporter {
}
private String asDependency(String artifactName) {
- return
"mvn@test:org.citrusframework:%s:\\$\\{citrus.version}".formatted(artifactName);
+ return
"mvn@test:org.citrusframework:%s:${citrus.version}".formatted(artifactName);
}
}
diff --git
a/dsl/camel-jbang/camel-jbang-plugin-test/src/test/java/org/apache/camel/dsl/jbang/core/commands/test/TestPluginTest.java
b/dsl/camel-jbang/camel-jbang-plugin-test/src/test/java/org/apache/camel/dsl/jbang/core/commands/test/TestPluginTest.java
index 086c39ff2c5b..d753789600d5 100644
---
a/dsl/camel-jbang/camel-jbang-plugin-test/src/test/java/org/apache/camel/dsl/jbang/core/commands/test/TestPluginTest.java
+++
b/dsl/camel-jbang/camel-jbang-plugin-test/src/test/java/org/apache/camel/dsl/jbang/core/commands/test/TestPluginTest.java
@@ -17,11 +17,15 @@
package org.apache.camel.dsl.jbang.core.commands.test;
+import java.io.IOException;
+import java.nio.file.Files;
import java.nio.file.Path;
+import java.util.Set;
import org.apache.camel.dsl.jbang.core.commands.CamelJBangMain;
import org.apache.camel.dsl.jbang.core.common.CommandLineHelper;
import org.apache.camel.dsl.jbang.core.common.Printer;
+import org.apache.camel.dsl.jbang.core.common.RuntimeType;
import org.apache.camel.dsl.jbang.core.common.StringPrinter;
import org.apache.camel.dsl.jbang.core.common.VersionHelper;
import org.citrusframework.spi.Resources;
@@ -107,6 +111,25 @@ class TestPluginTest {
""".trim(), printer.getOutput().trim());
}
+ @Test
+ public void shouldProduceValidMavenPropertyReferences() throws IOException
{
+ Path testDir = Path.of(".").resolve("test");
+ Files.createDirectories(testDir);
+ try {
+ TestPluginExporter exporter = new TestPluginExporter();
+ Set<String> deps = exporter.getDependencies(RuntimeType.quarkus);
+ Assertions.assertFalse(deps.isEmpty());
+ for (String dep : deps) {
+ Assertions.assertFalse(dep.contains("\\"),
+ "Dependency should not contain backslash escapes: " +
dep);
+ Assertions.assertTrue(dep.contains("${citrus.version}"),
+ "Dependency should contain valid Maven property
reference: " + dep);
+ }
+ } finally {
+ Files.deleteIfExists(testDir);
+ }
+ }
+
/**
* Creates CamelJBangMain instance ready for unit testing. Automatically
adds test plugin commands. Automatically
* sets the out printer.