1
1
package com .fasterxml .jackson .databind .jsontype .vld ;
2
2
3
- import java .net . URL ;
3
+ import java .util . TimeZone ;
4
4
5
5
import com .fasterxml .jackson .databind .BaseMapTest ;
6
6
import com .fasterxml .jackson .databind .ObjectMapper ;
@@ -57,7 +57,7 @@ public boolean match(MapperConfig<?> ctxt, Class<?> base) {
57
57
})
58
58
.build ();
59
59
ObjectMapper mapper = jsonMapperBuilder ()
60
- .activateDefaultTyping (ptv , DefaultTyping .EVERYTHING )
60
+ .activateDefaultTyping (ptv , DefaultTyping .NON_FINAL )
61
61
.build ();
62
62
// First: in this case, allow "Bad" one too (note: default typing based on
63
63
// runtime type here)
@@ -66,12 +66,12 @@ public boolean match(MapperConfig<?> ctxt, Class<?> base) {
66
66
assertEquals (CustomBad .class , result .getClass ());
67
67
68
68
// but other types not so good
69
- final String badJson = mapper .writeValueAsString (new URL ( "http://localhost" ) );
69
+ final String badJson = mapper .writeValueAsString (TimeZone . getDefault () );
70
70
try {
71
- mapper .readValue (badJson , URL .class );
71
+ mapper .readValue (badJson , TimeZone .class );
72
72
fail ("Should not pass" );
73
73
} catch (InvalidTypeIdException e ) {
74
- verifyException (e , "Could not resolve type id 'java.net.URL '" );
74
+ verifyException (e , "Could not resolve type id 'java.util.TimeZone '" );
75
75
verifyException (e , "as a subtype of" );
76
76
}
77
77
assertEquals (CustomBad .class , result .getClass ());
0 commit comments