File tree 2 files changed +12
-10
lines changed
src/test/java/com/fasterxml/jackson/databind/deser/creators 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -357,19 +357,21 @@ public void testPropertyCreatorEnum3280() throws Exception
357
357
// for [databind#3655]
358
358
public void testEnumsFromIntsUnwrapped () throws Exception
359
359
{
360
- Object ob = newJsonMapper ()
361
- .enable (DeserializationFeature .UNWRAP_SINGLE_VALUE_ARRAYS )
362
- .readValue ("[1]" , TestEnumFromInt .class );
360
+ Object ob = MAPPER
361
+ .readerFor (TestEnumFromInt .class )
362
+ .with (DeserializationFeature .UNWRAP_SINGLE_VALUE_ARRAYS )
363
+ .readValue ("[1]" );
363
364
assertEquals (TestEnumFromInt .class , ob .getClass ());
364
365
assertSame (TestEnumFromInt .ENUM_A , ob );
365
366
}
366
367
367
368
// for [databind#3655]
368
369
public void testEnumsFromStringUnwrapped () throws Exception
369
370
{
370
- Object ob = newJsonMapper ()
371
- .enable (DeserializationFeature .UNWRAP_SINGLE_VALUE_ARRAYS )
372
- .readValue ("[\" ENUM_A\" ]" , TestEnumFromString .class );
371
+ Object ob = MAPPER
372
+ .readerFor (TestEnumFromString .class )
373
+ .with (DeserializationFeature .UNWRAP_SINGLE_VALUE_ARRAYS )
374
+ .readValue ("[\" ENUM_A\" ]" );
373
375
assertEquals (TestEnumFromString .class , ob .getClass ());
374
376
assertSame (TestEnumFromString .ENUM_A , ob );
375
377
}
Original file line number Diff line number Diff line change @@ -207,10 +207,10 @@ public void testDeserializationFromString() throws Exception {
207
207
}
208
208
209
209
public void testDeserializationFromWrappedString () throws Exception {
210
- assertEquals ( "DELEG:testProduct" ,
211
- newJsonMapper ( )
212
- . enable ( DeserializationFeature . UNWRAP_SINGLE_VALUE_ARRAYS )
213
- . readValue ( "[ \" testProduct\" ]" , Product1853 . class ) .getName ());
210
+ Product1853 result = MAPPER . readerFor ( Product1853 . class )
211
+ . with ( DeserializationFeature . UNWRAP_SINGLE_VALUE_ARRAYS )
212
+ . readValue ( "[ \" testProduct \" ]" );
213
+ assertEquals ( "DELEG: testProduct" , result .getName ());
214
214
}
215
215
}
216
216
You can’t perform that action at this time.
0 commit comments