Skip to content
Draft
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 @@ -226,7 +226,10 @@ public Map<String, String> getMap(String name) {
String[] split = entry.split("=", 2);
if (split.length != 2 || StringUtils.isNullOrEmpty(split[0])) {
throw new ConfigurationException(
"Invalid map property: " + name + "=" + config.get(name));
"Invalid map property: "
+ name
+ "="
+ config.get(ConfigUtil.normalizePropertyKey(name)));
}
return filterBlanksAndNulls(split);
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@ void invalidMap() {
.hasMessage("Invalid map property: map=a=1,=b");
}

@Test
void invalidMapWithHyphenatedName() {
assertThatThrownBy(
() ->
DefaultConfigProperties.createFromMap(Collections.singletonMap("test-map", "a=1,b"))
.getMap("test-map"))
.isInstanceOf(ConfigurationException.class)
.hasMessage("Invalid map property: test-map=a=1,b");
}

@Test
void invalidDuration() {
assertThatThrownBy(
Expand Down
Loading