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