@@ -34,7 +34,7 @@ public void testMapWithBranchNoEscaping() throws Exception
34
34
assertEquals ("first" , w .map .get ("" ));
35
35
assertEquals ("second" , w .map .get ("b" ));
36
36
assertEquals ("third" , w .map .get ("xyz" ));
37
- assertEquals ("fourth" , ((Map ) w .map .get ("ab\\ " )).get ("c" ));
37
+ assertEquals ("fourth" , ((Map <?,?> ) w .map .get ("ab\\ " )).get ("c" ));
38
38
}
39
39
40
40
public void testMapWithBranchBackslashEscape () throws Exception
@@ -55,7 +55,9 @@ public void testMapWithBranchBackslashEscape() throws Exception
55
55
+"map.xy\\ \\ \\ \\ .d.ij=eleventh\n " // xy\\.d.ij => xy\->d->ij
56
56
+"map.xy\\ \\ \\ \\ \\ \\ .d.ij=twelfth\n " // xy\\\.d => xy\.d->ij
57
57
;
58
- MapWrapper w = mapper .reader (new JavaPropsSchema ().withPathSeparatorEscapeChar ('\\' )).readValue (INPUT , MapWrapper .class );
58
+ MapWrapper w = mapper .readerFor (MapWrapper .class )
59
+ .with (new JavaPropsSchema ().withPathSeparatorEscapeChar ('\\' ))
60
+ .readValue (INPUT );
59
61
assertNotNull (w .map );
60
62
System .out .println (w .map .toString ());
61
63
assertEquals (12 , w .map .size ());
@@ -66,11 +68,11 @@ public void testMapWithBranchBackslashEscape() throws Exception
66
68
assertEquals ("fifth" , w .map .get ("ab\\ cd.ef.gh\\ \\ ij" ));
67
69
assertEquals ("sixth" , w .map .get ("." ));
68
70
assertEquals ("seventh" , w .map .get ("ab.d" ));
69
- assertEquals ("eigth" , ((Map ) w .map .get ("ef\\ " )).get ("d" ));
71
+ assertEquals ("eigth" , ((Map <?,?> ) w .map .get ("ef\\ " )).get ("d" ));
70
72
assertEquals ("ninth" , w .map .get ("ab\\ .d" ));
71
- assertEquals ("tenth" , ((Map ) w .map .get ("xy.d" )).get ("ij" ));
72
- assertEquals ("eleventh" , ((Map ) ((Map ) w .map .get ("xy\\ " )).get ("d" )).get ("ij" ));
73
- assertEquals ("twelfth" , ((Map ) w .map .get ("xy\\ .d" )).get ("ij" ));
73
+ assertEquals ("tenth" , ((Map <?,?> ) w .map .get ("xy.d" )).get ("ij" ));
74
+ assertEquals ("eleventh" , ((Map <?,?> ) ((Map <?,?> ) w .map .get ("xy\\ " )).get ("d" )).get ("ij" ));
75
+ assertEquals ("twelfth" , ((Map <?,?> ) w .map .get ("xy\\ .d" )).get ("ij" ));
74
76
}
75
77
76
78
@@ -92,7 +94,8 @@ public void testMapWithBranchHashEscape() throws Exception
92
94
+"map.xy##.d.ij=eleventh\n " // xy##.d.ij => xy#->d->ij
93
95
+"map.xy###.d.ij=twelfth\n " // xy###.d => xy#.d->ij
94
96
;
95
- MapWrapper w = mapper .reader (new JavaPropsSchema ().withPathSeparatorEscapeChar ('#' )).readValue (INPUT , MapWrapper .class );
97
+ MapWrapper w = mapper .readerFor (MapWrapper .class )
98
+ .with (new JavaPropsSchema ().withPathSeparatorEscapeChar ('#' )).readValue (INPUT );
96
99
assertNotNull (w .map );
97
100
System .out .println (w .map .toString ());
98
101
assertEquals (12 , w .map .size ());
@@ -103,11 +106,11 @@ public void testMapWithBranchHashEscape() throws Exception
103
106
assertEquals ("fifth" , w .map .get ("ab#cd.ef.gh##ij" ));
104
107
assertEquals ("sixth" , w .map .get ("." ));
105
108
assertEquals ("seventh" , w .map .get ("ab.d" ));
106
- assertEquals ("eigth" , ((Map ) w .map .get ("ef#" )).get ("d" ));
109
+ assertEquals ("eigth" , ((Map <?,?> ) w .map .get ("ef#" )).get ("d" ));
107
110
assertEquals ("ninth" , w .map .get ("ab#.d" ));
108
- assertEquals ("tenth" , ((Map ) w .map .get ("xy.d" )).get ("ij" ));
109
- assertEquals ("eleventh" , ((Map ) ((Map ) w .map .get ("xy#" )).get ("d" )).get ("ij" ));
110
- assertEquals ("twelfth" , ((Map ) w .map .get ("xy#.d" )).get ("ij" ));
111
+ assertEquals ("tenth" , ((Map <?,?> ) w .map .get ("xy.d" )).get ("ij" ));
112
+ assertEquals ("eleventh" , ((Map <?,?> ) ((Map <?,?> ) w .map .get ("xy#" )).get ("d" )).get ("ij" ));
113
+ assertEquals ("twelfth" , ((Map <?,?> ) w .map .get ("xy#.d" )).get ("ij" ));
111
114
}
112
115
113
116
}
0 commit comments