use of com.linkedin.restli.examples.greetings.client.ComplexArrayRequestBuilders in project rest.li by linkedin.
the class TestComplexArrayResource method testBatchGetEntity.
@Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "versionWithRequestOptionsDataProvider")
public void testBatchGetEntity(ProtocolVersion version, RestliRequestOptions options) throws RemoteInvocationException {
List<ComplexResourceKey<ComplexArray, ComplexArray>> complexKeys = getBatchCompleKeys();
ComplexArrayRequestBuilders builders = new ComplexArrayRequestBuilders(options);
Request<BatchKVResponse<ComplexResourceKey<ComplexArray, ComplexArray>, EntityResponse<Greeting>>> request2 = builders.batchGet().ids(complexKeys).build();
Response<BatchKVResponse<ComplexResourceKey<ComplexArray, ComplexArray>, EntityResponse<Greeting>>> response2 = getClient().sendRequest(request2).getResponse();
EntityResponse<Greeting> greeting1 = response2.getEntity().getResults().get(complexKeys.get(0));
Assert.assertNotNull(greeting1);
EntityResponse<Greeting> greeting2 = response2.getEntity().getResults().get(complexKeys.get(1));
Assert.assertNotNull(greeting2);
}
Aggregations