Skip to content

Commit

Permalink
Rename #4607 test
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jul 3, 2024
1 parent ba79b85 commit 1bec2f0
Showing 1 changed file with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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);
}
}
Expand Down

0 comments on commit 1bec2f0

Please sign in to comment.