aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/org/sonarsource/scanner/cli/PropertyResolverTest.java
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2017-04-12 15:35:13 +0200
committerJulien HENRY <henryju@yahoo.fr>2017-04-12 20:57:37 +0200
commit3f8feb090594863155ce0cb1451128559965836d (patch)
tree31d51e65321bf813a6f205bb4490cceda0341879 /src/test/java/org/sonarsource/scanner/cli/PropertyResolverTest.java
parentab646a451062935cc9d9b32fbe80e3c489262230 (diff)
downloadsonar-scanner-cli-3f8feb090594863155ce0cb1451128559965836d.tar.gz
sonar-scanner-cli-3f8feb090594863155ce0cb1451128559965836d.zip
SQSCANNER-39 Don't filter properties with blank value
Diffstat (limited to 'src/test/java/org/sonarsource/scanner/cli/PropertyResolverTest.java')
-rw-r--r--src/test/java/org/sonarsource/scanner/cli/PropertyResolverTest.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/test/java/org/sonarsource/scanner/cli/PropertyResolverTest.java b/src/test/java/org/sonarsource/scanner/cli/PropertyResolverTest.java
index cece2a0..eecca98 100644
--- a/src/test/java/org/sonarsource/scanner/cli/PropertyResolverTest.java
+++ b/src/test/java/org/sonarsource/scanner/cli/PropertyResolverTest.java
@@ -19,16 +19,15 @@
*/
package org.sonarsource.scanner.cli;
-import static org.assertj.core.api.Assertions.assertThat;
-
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
-
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class PropertyResolverTest {
@Rule
public ExpectedException exception = ExpectedException.none();
@@ -120,4 +119,18 @@ public class PropertyResolverTest {
PropertyResolver resolver = new PropertyResolver(map, env);
resolver.resolve();
}
+
+ @Test
+ public void preserve_empty() {
+ Properties map = new Properties();
+ Map<String, String> env = new HashMap<>();
+
+ map.put("A", "");
+ map.put("B", "${A}");
+
+ PropertyResolver resolver = new PropertyResolver(map, env);
+ Properties resolved = resolver.resolve();
+ assertThat(resolved.get("A")).isEqualTo("");
+ assertThat(resolved.get("B")).isEqualTo("");
+ }
}