diff --git a/spring-boot/src/test/java/org/springframework/boot/bind/RelaxedDataBinderTests.java b/spring-boot/src/test/java/org/springframework/boot/bind/RelaxedDataBinderTests.java index 4852ebbcf3..310d2eef4b 100644 --- a/spring-boot/src/test/java/org/springframework/boot/bind/RelaxedDataBinderTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/bind/RelaxedDataBinderTests.java @@ -334,6 +334,15 @@ public class RelaxedDataBinderTests { assertEquals("123", target.getNested().get(Bingo.THAT)); } + @Test + public void testBindNestedMapOfEnumRelaxedNames() throws Exception { + this.conversionService = new DefaultConversionService(); + TargetWithNestedMapOfEnum target = new TargetWithNestedMapOfEnum(); + bind(target, "nested.the-other: bar\n" + "nested.that_other: 123"); + assertEquals("bar", target.getNested().get(Bingo.THE_OTHER)); + assertEquals("123", target.getNested().get(Bingo.THAT_OTHER)); + } + @Test public void testBindNestedMapBracketReferenced() throws Exception { TargetWithNestedMap target = new TargetWithNestedMap(); @@ -969,7 +978,7 @@ public class RelaxedDataBinderTests { } enum Bingo { - THIS, or, THAT, THE_OTHER + THIS, or, THAT, THE_OTHER, THAT_OTHER } public static class ValidatedTarget {