Request<BatchResponse<Greeting>> request = batchGetBuilder.ids(1L).build();
ResponseFuture<BatchResponse<Greeting>> future = REST_CLIENT.sendRequest(request);
Response<BatchResponse<Greeting>> greetingResponse = future.getResponse();
// PUT
Greeting greeting = new Greeting(greetingResponse.getEntity().getResults().get("1").data().copy());
greeting.setMessage("This is a new message!");
Request<BatchKVResponse<Long, UpdateStatus>> writeRequest = builders.batchUpdate().input(1L, greeting).build();
REST_CLIENT.sendRequest(writeRequest).getResponse();
// GET again, to verify that our POST worked.
Request<BatchResponse<Greeting>> request2 = batchGetBuilder.ids(1L).build();
ResponseFuture<BatchResponse<Greeting>> future2 = REST_CLIENT.sendRequest(request2);
greetingResponse = future2.get();
Greeting repeatedGreeting = new Greeting();
repeatedGreeting.setMessage("Hello Hello");
repeatedGreeting.setTone(Tone.SINCERE);
Request<CollectionResponse<CreateStatus>> request3 = builders.batchCreate().inputs(Arrays.asList(repeatedGreeting, repeatedGreeting)).build();
CollectionResponse<CreateStatus> statuses = REST_CLIENT.sendRequest(request3).getResponse().getEntity();
for (CreateStatus status : statuses.getElements())
{
Assert.assertEquals(status.getStatus().intValue(), HttpStatus.S_201_CREATED.getCode());