use of com.linkedin.restli.examples.greetings.api.ComplexArray in project rest.li by linkedin.
the class TestComplexArrayResource method testBatchGet.
@Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "versionWithRequestOptionsDataProvider")
public void testBatchGet(ProtocolVersion version, RestliRequestOptions options) throws RemoteInvocationException {
List<ComplexResourceKey<ComplexArray, ComplexArray>> complexKeys = getBatchCompleKeys();
ComplexArrayBuilders builders = new ComplexArrayBuilders(options);
Request<BatchKVResponse<ComplexResourceKey<ComplexArray, ComplexArray>, Greeting>> request = builders.batchGet().ids(complexKeys).buildKV();
Response<BatchKVResponse<ComplexResourceKey<ComplexArray, ComplexArray>, Greeting>> response = getClient().sendRequest(request).getResponse();
Greeting greeting1 = response.getEntity().getResults().get(complexKeys.get(0));
Assert.assertNotNull(greeting1);
Greeting greeting2 = response.getEntity().getResults().get(complexKeys.get(1));
Assert.assertNotNull(greeting2);
}
use of com.linkedin.restli.examples.greetings.api.ComplexArray in project rest.li by linkedin.
the class TestComplexArrayResource method testFinder.
@Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestBuilderDataProvider")
public void testFinder(RootBuilderWrapper<ComplexResourceKey<ComplexArray, ComplexArray>, Greeting> builders) throws RemoteInvocationException {
LongArray singleton = new LongArray();
singleton.add(1L);
ComplexArray next = new ComplexArray().setArray(singleton);
ComplexArray array = new ComplexArray().setArray(singleton).setNext(next);
Request<CollectionResponse<Greeting>> request = builders.findBy("Finder").setQueryParam("array", array).build();
getClient().sendRequest(request).getResponse().getEntity();
}
Aggregations