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
pull/3649/merge
Stephane Nicoll 9 years ago
parent f4723efaed
commit ad6fb55958

@ -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 {

Loading…
Cancel
Save