Parcourir la source

Improve test

tags/5.2-RC1
Julien HENRY il y a 8 ans
Parent
révision
d365b10b5d

+ 9
- 1
sonar-batch/src/test/java/org/sonar/batch/scan/ProjectReactorBuilderTest.java Voir le fichier

@@ -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";

Chargement…
Annuler
Enregistrer