Search in sources :

Example 21 with ResourceSpec

use of com.linkedin.restli.common.ResourceSpec in project rest.li by linkedin.

the class TestResourceSchemaToResourceSpecTranslator method testTranslator.

@Test(dataProvider = "restspecsAndBuilders")
public void testTranslator(RichResourceSchema resourceSchema, String subresource, Class<?> resourceBuildersClass) throws Exception {
    if (subresource != null) {
        resourceSchema = resourceSchema.getSubresource(subresource);
    }
    ResourceSpec actualResourceSpec = translator.translate(resourceSchema.getResourceSchema());
    ResourceSpec expectedResourceSpec = getResourceSpecFromClientBuilders(resourceBuildersClass);
    compareResourceSpecs(actualResourceSpec, expectedResourceSpec, resourceSchema);
}
Also used : ResourceSpec(com.linkedin.restli.common.ResourceSpec) Test(org.testng.annotations.Test)

Aggregations

ResourceSpec (com.linkedin.restli.common.ResourceSpec)21 Test (org.testng.annotations.Test)15 TestRecord (com.linkedin.restli.client.test.TestRecord)14 ResourceSpecImpl (com.linkedin.restli.common.ResourceSpecImpl)9 HashMap (java.util.HashMap)7 ByteString (com.linkedin.data.ByteString)5 CompoundKey (com.linkedin.restli.common.CompoundKey)5 ResourceMethod (com.linkedin.restli.common.ResourceMethod)5 DynamicRecordMetadata (com.linkedin.data.template.DynamicRecordMetadata)4 FieldDef (com.linkedin.data.template.FieldDef)4 DataMap (com.linkedin.data.DataMap)2 DynamicRecordTemplate (com.linkedin.data.template.DynamicRecordTemplate)2 ResourcePropertiesImpl (com.linkedin.restli.internal.common.ResourcePropertiesImpl)2 CollectionRequest (com.linkedin.restli.common.CollectionRequest)1 ComplexResourceKey (com.linkedin.restli.common.ComplexResourceKey)1 EmptyRecord (com.linkedin.restli.common.EmptyRecord)1 ResourceProperties (com.linkedin.restli.common.ResourceProperties)1 RichResourceSchema (com.linkedin.restli.common.util.RichResourceSchema)1 RestLiTestAttachmentDataSource (com.linkedin.restli.internal.testutils.RestLiTestAttachmentDataSource)1 ResourceSchema (com.linkedin.restli.restspec.ResourceSchema)1