Search in sources :

Example 21 with ResourceSchema

use of com.google.api.server.spi.config.ResourceSchema in project endpoints-java by cloudendpoints.

the class ResourceSchemaProviderTest method testConfigCustomResourceSerializedInheritedPropertyReturnsSchema.

@Test
public void testConfigCustomResourceSerializedInheritedPropertyReturnsSchema() {
    config.getSerializationConfig().addSerializationConfig(SinglePropertyResourceSerializer.class);
    ResourceSchema schema = getResourceSchema(SinglePropertyBeanChild.class);
    String name = SinglePropertyBeanChild.class.getSimpleName();
    assertThat(schema.getProperties().keySet()).containsExactly(name);
    assertEquals(Long.class, schema.getProperties().get(name).getJavaType());
}
Also used : ResourceSchema(com.google.api.server.spi.config.ResourceSchema) Test(org.junit.Test)

Aggregations

ResourceSchema (com.google.api.server.spi.config.ResourceSchema)21 Test (org.junit.Test)18 ResourcePropertySchema (com.google.api.server.spi.config.ResourcePropertySchema)3 BeanDescription (com.fasterxml.jackson.databind.BeanDescription)1 JavaType (com.fasterxml.jackson.databind.JavaType)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 BeanPropertyDefinition (com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition)1 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 Field (com.google.api.server.spi.config.model.Schema.Field)1