add settings loader for yaml pipe

This commit is contained in:
Jörg Prante 2024-05-22 17:13:33 +02:00
parent 1330905066
commit e9558c906f

View file

@ -49,13 +49,21 @@ public class YamlSettingsTest {
} }
@Test @Test
public void testMultiLineString() throws IOException { public void testRightAngleString() throws IOException {
String s = "test: >\n this is a\n multiline\n string\na: b\b"; String s = "test: >\n this is a\n multiline\n string\na: b\b";
SettingsLoader loader = new YamlSettingsLoader(); SettingsLoader loader = new YamlSettingsLoader();
Map<String, String> map = loader.load(s); Map<String, String> map = loader.load(s);
assertEquals("{test=this is a multiline string, a=b}", map.toString()); assertEquals("{test=this is a multiline string, a=b}", map.toString());
} }
@Test
public void testPipeString() throws IOException {
String s = "test: |\n this is a\n multiline\n string\na: b\b";
SettingsLoader loader = new YamlSettingsLoader();
Map<String, String> map = loader.load(s);
assertEquals("{test=this is a\nmultiline\nstring, a=b}", map.toString());
}
@Test @Test
public void testLoadFromMap() throws IOException { public void testLoadFromMap() throws IOException {
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();