Skip to content

Commit 1aaa165

Browse files
committed
Minor test improvement
1 parent 8dc2371 commit 1aaa165

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/test/java/com/fasterxml/jackson/databind/jsontype/vld/CustomPTVMatchersTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.fasterxml.jackson.databind.jsontype.vld;
22

3-
import java.net.URL;
3+
import java.util.TimeZone;
44

55
import com.fasterxml.jackson.databind.BaseMapTest;
66
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -57,7 +57,7 @@ public boolean match(MapperConfig<?> ctxt, Class<?> base) {
5757
})
5858
.build();
5959
ObjectMapper mapper = jsonMapperBuilder()
60-
.activateDefaultTyping(ptv, DefaultTyping.EVERYTHING)
60+
.activateDefaultTyping(ptv, DefaultTyping.NON_FINAL)
6161
.build();
6262
// First: in this case, allow "Bad" one too (note: default typing based on
6363
// runtime type here)
@@ -66,12 +66,12 @@ public boolean match(MapperConfig<?> ctxt, Class<?> base) {
6666
assertEquals(CustomBad.class, result.getClass());
6767

6868
// but other types not so good
69-
final String badJson = mapper.writeValueAsString(new URL("http://localhost") );
69+
final String badJson = mapper.writeValueAsString(TimeZone.getDefault());
7070
try {
71-
mapper.readValue(badJson, URL.class);
71+
mapper.readValue(badJson, TimeZone.class);
7272
fail("Should not pass");
7373
} 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'");
7575
verifyException(e, "as a subtype of");
7676
}
7777
assertEquals(CustomBad.class, result.getClass());

0 commit comments

Comments
 (0)