From 1bec2f0eef0d58ae6eaf77dd7d2a53bcad42df04 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Tue, 2 Jul 2024 19:33:37 -0700 Subject: [PATCH] Rename #4607 test --- ...Test.java => ObjectIdSubTypes4607Test.java} | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) rename src/test/java/com/fasterxml/jackson/failing/{TypeId4607Test.java => ObjectIdSubTypes4607Test.java} (73%) diff --git a/src/test/java/com/fasterxml/jackson/failing/TypeId4607Test.java b/src/test/java/com/fasterxml/jackson/failing/ObjectIdSubTypes4607Test.java similarity index 73% rename from src/test/java/com/fasterxml/jackson/failing/TypeId4607Test.java rename to src/test/java/com/fasterxml/jackson/failing/ObjectIdSubTypes4607Test.java index 6ca992e914..3eb8a69261 100644 --- a/src/test/java/com/fasterxml/jackson/failing/TypeId4607Test.java +++ b/src/test/java/com/fasterxml/jackson/failing/ObjectIdSubTypes4607Test.java @@ -2,19 +2,16 @@ import java.util.List; -import com.fasterxml.jackson.annotation.JsonIdentityInfo; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.ObjectIdGenerators; -import com.fasterxml.jackson.databind.ObjectMapper; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import static com.fasterxml.jackson.databind.BaseMapTest.newJsonMapper; +import com.fasterxml.jackson.annotation.*; -public class TypeId4607Test { +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; +public class ObjectIdSubTypes4607Test extends DatabindTestUtil +{ @JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME) @JsonSubTypes({ @@ -31,16 +28,13 @@ static class EnumTypeDefinition implements TypeDefinition { static class NumberTypeDefinition implements TypeDefinition { } - private static final ObjectMapper mapper = newJsonMapper(); - @Test public void shouldHandleTypeDefinitionJson() throws Exception { + final ObjectMapper mapper = newJsonMapper(); String input = "{" + " \"@type\": \"number\" " + " }"; - TypeDefinition model = mapper.readValue(input, TypeDefinition.class); - Assertions.assertInstanceOf(NumberTypeDefinition.class, model); } }