From 3c4607611c8153a8626d504a7c3627f11f24f12b Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Tue, 2 May 2017 13:35:46 +0200 Subject: Add unit tests var substitions --- .../org/sonarsource/scanner/cli/PropertyResolverTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/test/java/org/sonarsource') diff --git a/src/test/java/org/sonarsource/scanner/cli/PropertyResolverTest.java b/src/test/java/org/sonarsource/scanner/cli/PropertyResolverTest.java index eecca98..5391671 100644 --- a/src/test/java/org/sonarsource/scanner/cli/PropertyResolverTest.java +++ b/src/test/java/org/sonarsource/scanner/cli/PropertyResolverTest.java @@ -104,6 +104,18 @@ public class PropertyResolverTest { assertThat(resolved.get("B")).isEqualTo("value b"); assertThat(resolved.get("C")).isEqualTo("${A value b}"); } + + @Test + public void missing_var() { + Map env = new HashMap<>(); + Properties map = new Properties(); + map.put("A", "/path/$missing var/"); + + PropertyResolver resolver = new PropertyResolver(map, env); + Properties resolved = resolver.resolve(); + assertThat(resolved.get("A")).isEqualTo("/path/ var/"); + + } @Test public void fail_loop_properties_resolution() { -- cgit v1.2.3