use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonTypeInfo in project jsonschema2pojo by joelittlejohn.
the class IncludeTypeInfoIT method disabledWithSchemaProperty.
@Test
public void disabledWithSchemaProperty() throws ClassNotFoundException {
ClassLoader classLoader = schemaRule.generateAndCompile("/schema/typeInfo/typeInfoWithSchemaProperty.json", "com.example", config("includeTypeInfo", false));
Class<?> classWithTypeInfo = classLoader.loadClass("com.example.TypeInfoWithSchemaProperty");
assertNotNull(classWithTypeInfo.getAnnotation(JsonTypeInfo.class));
JsonTypeInfo jsonTypeInfo = classWithTypeInfo.getAnnotation(JsonTypeInfo.class);
assertThat(jsonTypeInfo.use(), is(JsonTypeInfo.Id.CLASS));
assertThat(jsonTypeInfo.include(), is(JsonTypeInfo.As.PROPERTY));
assertThat(jsonTypeInfo.property(), is("@clazz"));
}
use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonTypeInfo in project jsonschema2pojo by joelittlejohn.
the class IncludeTypeInfoIT method enabledWithSchemaProperty.
@Test
public void enabledWithSchemaProperty() throws ClassNotFoundException {
ClassLoader classLoader = schemaRule.generateAndCompile("/schema/typeInfo/typeInfoWithSchemaProperty.json", "com.example", config("includeTypeInfo", true));
Class<?> classWithTypeInfo = classLoader.loadClass("com.example.TypeInfoWithSchemaProperty");
assertNotNull(classWithTypeInfo.getAnnotation(JsonTypeInfo.class));
JsonTypeInfo jsonTypeInfo = classWithTypeInfo.getAnnotation(JsonTypeInfo.class);
assertThat(jsonTypeInfo.use(), is(JsonTypeInfo.Id.CLASS));
assertThat(jsonTypeInfo.include(), is(JsonTypeInfo.As.PROPERTY));
assertThat(jsonTypeInfo.property(), is("@clazz"));
}
Aggregations