Search in sources :

Example 1 with DateCoercer

use of com.linkedin.restli.examples.custom.types.DateCoercer in project rest.li by linkedin.

the class TestCustomTypesRequestBuilders method testAssociationKeys.

@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "request3BuilderDataProviderEntity")
public void testAssociationKeys(RootBuilderWrapper<CompoundKey, Greeting> builders, ProtocolVersion version, String expectedUri) throws IOException, RestException {
    // normally coercer registration is handled in RestliAnnotationReader,
    // but that isn't run here because this is just a unit test.  So, we need to
    // force registration of the DateCoercer because it isn't contained in Date itself.
    new DateCoercer();
    CustomTypes3Builders.Key key = new CustomTypes3Builders.Key().setLongId(new CustomLong(5L)).setDateId(new Date(13L));
    Request<Greeting> request = builders.get().id(key).build();
    checkRequestBuilder(request, ResourceMethod.GET, EntityResponseDecoder.class, expectedUri, null, version);
}
Also used : Greeting(com.linkedin.restli.examples.greetings.api.Greeting) CustomTypes3Builders(com.linkedin.restli.examples.greetings.client.CustomTypes3Builders) DateCoercer(com.linkedin.restli.examples.custom.types.DateCoercer) CustomLong(com.linkedin.restli.examples.custom.types.CustomLong) CompoundKey(com.linkedin.restli.common.CompoundKey) Date(java.util.Date) Test(org.testng.annotations.Test)

Aggregations

CompoundKey (com.linkedin.restli.common.CompoundKey)1 CustomLong (com.linkedin.restli.examples.custom.types.CustomLong)1 DateCoercer (com.linkedin.restli.examples.custom.types.DateCoercer)1 Greeting (com.linkedin.restli.examples.greetings.api.Greeting)1 CustomTypes3Builders (com.linkedin.restli.examples.greetings.client.CustomTypes3Builders)1 Date (java.util.Date)1 Test (org.testng.annotations.Test)1