Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,7 @@ private static Map<String, String> scan(File directory) {
}

private static String readContent(Path file) {
try (Stream<String> stream = Files.lines(file)) {
return stream.collect(Collectors.joining());
} catch (IOException e) {
throw new UncheckedIOException(e);
}
return Files.readString(file);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,13 @@ void testCharacterReplacement() throws URISyntaxException {
// you can't rewrite the key, only the file name
assertNull(configSource.getValue("MYSERVICE_MP_REST_URL"));
}

@Test
void testMultilineValue() throws URISyntaxException {
URL configDirURL = this.getClass().getResource("configDir");
File dir = new File(configDirURL.toURI());

ConfigSource configSource = new FileSystemConfigSource(dir);
assertEquals("line 1\n\n \nline with trailing spaces \n\n", configSource.getValue("foo"));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
line 1


line with trailing spaces

Loading