You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/07/02 14:14:56 UTC
(camel) 01/01: CAMEL-23881: Fix escaped Maven property reference in TestPluginExporter
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch fix/CAMEL-23881
in repository https://gitbox.apache.org/repos/asf/camel.git
commit cafaaabbe64f1efd3e4d8a48fcd41ea8beb78a66
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Jul 2 16:14:35 2026 +0200
CAMEL-23881: Fix escaped Maven property reference in TestPluginExporter
Co-Authored-By: Claude <no...@anthropic.com>
Signed-off-by: Claus Ibsen <cl...@gmail.com>
---
.../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.