use of com.linkedin.restli.examples.greetings.client.TyperefKeysBuilders in project rest.li by linkedin.
the class TestTyperefKeysResource method testBatchGet.
@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestOptionsDataProvider")
public void testBatchGet(RestliRequestOptions requestOptions) throws RemoteInvocationException {
BatchGetRequest<Greeting> req = new TyperefKeysBuilders(requestOptions).batchGet().ids(1L, 2L).build();
Response<BatchResponse<Greeting>> resp = getClient().sendRequest(req).getResponse();
Map<String, Greeting> results = resp.getEntity().getResults();
Assert.assertEquals(results.get("1").getId(), new Long(1L));
Assert.assertEquals(results.get("2").getId(), new Long(2L));
}
use of com.linkedin.restli.examples.greetings.client.TyperefKeysBuilders in project rest.li by linkedin.
the class TestTyperefKeysResource method testBatchGetKV.
@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestOptionsDataProvider")
public void testBatchGetKV(RestliRequestOptions requestOptions) throws RemoteInvocationException {
BatchGetKVRequest<Long, Greeting> req = new TyperefKeysBuilders(requestOptions).batchGet().ids(1L, 2L).buildKV();
Response<BatchKVResponse<Long, Greeting>> resp = getClient().sendRequest(req).getResponse();
Map<Long, Greeting> results = resp.getEntity().getResults();
Assert.assertEquals(results.get(1L).getId(), new Long(1L));
Assert.assertEquals(results.get(2L).getId(), new Long(2L));
}
use of com.linkedin.restli.examples.greetings.client.TyperefKeysBuilders in project rest.li by linkedin.
the class TestTyperefKeysResource method testCreate.
@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestOptionsDataProvider")
@SuppressWarnings("deprecation")
public void testCreate(RestliRequestOptions requestOptions) throws RemoteInvocationException {
Greeting greeting = new Greeting().setId(1L).setMessage("Foo").setTone(Tone.FRIENDLY);
CreateRequest<Greeting> req = new TyperefKeysBuilders(requestOptions).create().input(greeting).build();
Response<EmptyRecord> resp = getClient().sendRequest(req).getResponse();
Assert.assertEquals(resp.getId(), "1");
}
Aggregations