File tree Expand file tree Collapse file tree 4 files changed +12
-6
lines changed
cbor/src/test/java/tools/jackson/dataformat/cbor/mapper
smile/src/test/java/tools/jackson/dataformat/smile/mapper Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -218,8 +218,9 @@ public void testSimpleMapImitation() throws Exception
218
218
public void testAnySetterDisable () throws Exception
219
219
{
220
220
try {
221
- MAPPER .readValue (cborDoc (aposToQuotes ("{'value':3}" )),
222
- MapImitatorDisabled .class );
221
+ MAPPER .readerFor (MapImitatorDisabled .class )
222
+ .with (DeserializationFeature .FAIL_ON_UNKNOWN_PROPERTIES )
223
+ .readValue (cborDoc (aposToQuotes ("{'value':3}" )));
223
224
fail ("Should not pass" );
224
225
} catch (UnrecognizedPropertyException e ) {
225
226
verifyException (e , "Unrecognized property \" value\" " );
Original file line number Diff line number Diff line change @@ -53,7 +53,9 @@ public void testCaseInsensitiveDeserialization() throws Exception
53
53
ObjectMapper mapper = sharedMapper ();
54
54
assertFalse (mapper .isEnabled (MapperFeature .ACCEPT_CASE_INSENSITIVE_PROPERTIES ));
55
55
try {
56
- mapper .readValue (DOC , Issue476Bean .class );
56
+ mapper .readerFor (Issue476Bean .class )
57
+ .with (DeserializationFeature .FAIL_ON_UNKNOWN_PROPERTIES )
58
+ .readValue (DOC );
57
59
fail ("Should not accept improper case properties by default" );
58
60
} catch (UnrecognizedPropertyException e ) {
59
61
verifyException (e , "Unrecognized property " );
Original file line number Diff line number Diff line change @@ -218,8 +218,9 @@ public void testSimpleMapImitation() throws Exception
218
218
public void testAnySetterDisable () throws Exception
219
219
{
220
220
try {
221
- MAPPER .readValue (_smileDoc (aposToQuotes ("{'value':3}" )),
222
- MapImitatorDisabled .class );
221
+ MAPPER .readerFor (MapImitatorDisabled .class )
222
+ .with (DeserializationFeature .FAIL_ON_UNKNOWN_PROPERTIES )
223
+ .readValue (_smileDoc (aposToQuotes ("{'value':3}" )));
223
224
fail ("Should not pass" );
224
225
} catch (UnrecognizedPropertyException e ) {
225
226
verifyException (e , "Unrecognized property \" value\" " );
Original file line number Diff line number Diff line change @@ -53,7 +53,9 @@ public void testCaseInsensitiveDeserialization() throws Exception
53
53
ObjectMapper mapper = newSmileMapper ();
54
54
assertFalse (mapper .isEnabled (MapperFeature .ACCEPT_CASE_INSENSITIVE_PROPERTIES ));
55
55
try {
56
- mapper .readValue (DOC , Issue476Bean .class );
56
+ mapper .readerFor (Issue476Bean .class )
57
+ .with (DeserializationFeature .FAIL_ON_UNKNOWN_PROPERTIES )
58
+ .readValue (DOC );
57
59
fail ("Should not accept improper case properties by default" );
58
60
} catch (UnrecognizedPropertyException e ) {
59
61
verifyException (e , "Unrecognized property " );
You can’t perform that action at this time.
0 commit comments