Add relaxed names for enum test
Add an extra test that demonstrate the use of relaxed binding for Enum when it is used as a map key. See gh-2465
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user