}
@Test
public void updateParameterizedTypeJSON() throws ExecutionException, InterruptedException, JsonProcessingException
{
RiakClient client = new RiakClient(cluster);
Namespace ns = new Namespace(Namespace.DEFAULT_BUCKET_TYPE, bucketName.toString());
Location loc = new Location(ns, "test_ORM_key3");
MyUpdate update = new MyUpdate();
TypeReference<GenericPojo<Integer>> tr =
new TypeReference<GenericPojo<Integer>>(){};
UpdateValue uv = new UpdateValue.Builder(loc)
.withUpdate(update, tr)
.withStoreOption(Option.RETURN_BODY, true)
.build();
UpdateValue.Response resp = client.execute(uv);
GenericPojo<Integer> gpi = resp.getValue(tr);
assertNotNull(gpi);
assertNotNull(gpi.value);
assertEquals(1, gpi.value.intValue());
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new RiakJacksonModule());
String json = mapper.writeValueAsString(gpi);
RiakObject ro = resp.getValue(RiakObject.class);
assertEquals(json, ro.getValue().toString());
resp = client.execute(uv);
gpi = resp.getValue(tr);
assertNotNull(gpi);
assertNotNull(gpi.value);
assertEquals(2, gpi.value.intValue());
}