use of com.linkedin.restli.examples.greetings.client.AssociationsBuilders in project rest.li by linkedin.
the class TestAssociationsResource method testBatchGet.
@Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestOptionsDataProvider")
public void testBatchGet(RestliRequestOptions requestOptions) throws RemoteInvocationException {
Request<BatchKVResponse<CompoundKey, Message>> request = new AssociationsBuilders(requestOptions).batchGet().ids(DB.keySet()).buildKV();
ResponseFuture<BatchKVResponse<CompoundKey, Message>> responseFuture = getClient().sendRequest(request);
Response<BatchKVResponse<CompoundKey, Message>> response = responseFuture.getResponse();
BatchKVResponse<CompoundKey, Message> entity = response.getEntity();
Assert.assertEquals(entity.getErrors().size(), 0);
Assert.assertEquals(entity.getResults().size(), 2);
for (CompoundKey id : DB.keySet()) {
Assert.assertTrue(entity.getResults().containsKey(id));
Assert.assertEquals(entity.getResults().get(id), DB.get(id));
}
}
Aggregations