Namespace ns = new Namespace(bucketType, bucketName.toString());
Location loc = new Location(ns, "test_fetch_key5");
String jsonValue = "{\"value\":\"my value\"}";
RiakObject ro = new RiakObject()
.setValue(BinaryValue.create(jsonValue))
.setContentType("application/json");
StoreValue sv = new StoreValue.Builder(ro).withLocation(loc).build();
client.execute(sv);
FetchValue fv = new FetchValue.Builder(loc).build();
FetchValue.Response resp = client.execute(fv);
RiakAnnotatedPojo rap = resp.getValue(RiakAnnotatedPojo.class);
assertNotNull(rap.bucketName);
assertEquals(ns.getBucketNameAsString(), rap.bucketName);
assertNotNull(rap.key);
assertEquals(loc.getKeyAsString(), rap.key);
assertNotNull(rap.bucketType);
assertEquals(ns.getBucketTypeAsString(), rap.bucketType);
assertNotNull(rap.contentType);
assertEquals(ro.getContentType(), rap.contentType);
assertNotNull(rap.vclock);
assertNotNull(rap.vtag);
assertNotNull(rap.lastModified);
assertNotNull(rap.value);
assertFalse(rap.deleted);