use of com.linkedin.restli.examples.custom.types.CustomLong in project rest.li by linkedin.
the class TestCustomTypesClient method testCustomLongArray.
@Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestBuilderDataProvider")
public void testCustomLongArray(RootBuilderWrapper<Long, Greeting> builders) throws RemoteInvocationException {
List<CustomLong> ls = new ArrayList<CustomLong>(2);
ls.add(new CustomLong(1L));
ls.add(new CustomLong(2L));
Request<CollectionResponse<Greeting>> request = builders.findBy("CustomLongArray").setQueryParam("ls", ls).build();
List<Greeting> elements = getClient().sendRequest(request).getResponse().getEntity().getElements();
Assert.assertEquals(elements.size(), 0);
}
use of com.linkedin.restli.examples.custom.types.CustomLong in project rest.li by linkedin.
the class TestCustomTypesRequestBuilders method testCollectionBatchGetEntityKey.
@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "request2BatchDataProvider")
public void testCollectionBatchGetEntityKey(ProtocolVersion version, String expectedUri) throws IOException, RestException {
Request<BatchKVResponse<CustomLong, EntityResponse<Greeting>>> request = new CustomTypes2RequestBuilders().batchGet().ids(new CustomLong(1L), new CustomLong(2L), new CustomLong(3L)).build();
checkRequestBuilder(request, ResourceMethod.BATCH_GET, BatchEntityResponseDecoder.class, expectedUri, null, version);
}
use of com.linkedin.restli.examples.custom.types.CustomLong in project rest.li by linkedin.
the class CustomTypesResource3 method get.
@Override
public Greeting get(CompoundKey key) {
CustomLong longId = (CustomLong) key.getPart("longId");
Date dateId = (Date) key.getPart("dateId");
return new Greeting().setId(longId.toLong() + dateId.getTime());
}
Aggregations