]> source.dussan.org Git - sonarqube.git/commitdiff
Improve test
authorJulien HENRY <julien.henry@sonarsource.com>
Tue, 29 Sep 2015 07:13:22 +0000 (09:13 +0200)
committerJulien HENRY <julien.henry@sonarsource.com>
Thu, 1 Oct 2015 09:54:05 +0000 (11:54 +0200)
sonar-batch/src/test/java/org/sonar/batch/scan/ProjectReactorBuilderTest.java

index b55f0c64e31ba46646cb15a36a3f2033c239e790..e5206b732c3133b1db010e7c2a85811e101098a0 100644 (file)
@@ -593,10 +593,18 @@ public class ProjectReactorBuilderTest {
   public void shouldGetList() {
     Map<String, String> props = new HashMap<>();
 
-    props.put("prop", "  foo  ,  bar  , \n\ntoto,tutu");
+    props.put("prop", "  foo  ,,  bar  , \n\ntoto,tutu");
     assertThat(ProjectReactorBuilder.getListFromProperty(props, "prop")).containsOnly("foo", "bar", "toto", "tutu");
   }
 
+  @Test
+  public void shouldGetEmptyList() {
+    Map<String, String> props = new HashMap<>();
+
+    props.put("prop", "");
+    assertThat(ProjectReactorBuilder.getListFromProperty(props, "prop")).isEmpty();
+  }
+
   @Test
   public void shouldGetListFromFile() throws IOException {
     String filePath = "shouldGetList/foo.properties";