Search in sources :

Example 11 with GreetingsBuilders

use of com.linkedin.restli.examples.greetings.client.GreetingsBuilders in project rest.li by linkedin.

the class TestGreetingClientContentTypes method testBatchGetKV.

@Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "clientDataBatchDataProvider")
public void testBatchGetKV(RestClient restClient, RestliRequestOptions requestOptions) throws RemoteInvocationException {
    List<Long> ids = Arrays.asList(1L, 2L, 3L, 4L);
    Request<BatchKVResponse<Long, Greeting>> request = new GreetingsBuilders(requestOptions).batchGet().ids(ids).buildKV();
    Response<BatchKVResponse<Long, Greeting>> response = restClient.sendRequest(request).getResponse();
    BatchKVResponse<Long, Greeting> batchResponse = response.getEntity();
    Assert.assertEquals(batchResponse.getResults().size(), ids.size());
}
Also used : GreetingsBuilders(com.linkedin.restli.examples.greetings.client.GreetingsBuilders) Greeting(com.linkedin.restli.examples.greetings.api.Greeting) BatchKVResponse(com.linkedin.restli.client.response.BatchKVResponse) Test(org.testng.annotations.Test)

Aggregations

GreetingsBuilders (com.linkedin.restli.examples.greetings.client.GreetingsBuilders)11 Greeting (com.linkedin.restli.examples.greetings.api.Greeting)9 Test (org.testng.annotations.Test)9 BatchResponse (com.linkedin.restli.common.BatchResponse)5 RestClient (com.linkedin.restli.client.RestClient)3 BatchKVResponse (com.linkedin.restli.client.response.BatchKVResponse)3 GreetingsRequestBuilders (com.linkedin.restli.examples.greetings.client.GreetingsRequestBuilders)3 HashMap (java.util.HashMap)3 CollectionResponse (com.linkedin.restli.common.CollectionResponse)2 CreateStatus (com.linkedin.restli.common.CreateStatus)2 CompressionConfig (com.linkedin.r2.filter.CompressionConfig)1 Client (com.linkedin.r2.transport.common.Client)1 TransportClientAdapter (com.linkedin.r2.transport.common.bridge.client.TransportClientAdapter)1 HttpClientFactory (com.linkedin.r2.transport.http.client.HttpClientFactory)1 NamedThreadFactory (com.linkedin.r2.util.NamedThreadFactory)1 CreateResponse (com.linkedin.restli.client.response.CreateResponse)1 EmptyRecord (com.linkedin.restli.common.EmptyRecord)1 NioEventLoopGroup (io.netty.channel.nio.NioEventLoopGroup)1 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)1 DataProvider (org.testng.annotations.DataProvider)1