try {
Request request = AppDataService.getAppData();
Response response = client.send(request);
AppData data = response.getEntry();
assertTrue(data.getDataForUser(ORKUT_ID, "key1").equals(randomValue1));
assertTrue(data.getDataForUser(ORKUT_ID, "key2").equals(randomValue2));
} catch (Exception e) {
fail("Exception occurred while processing retrieve request");
}
try {
Request request = AppDataService.deleteAppData(
new String[] {"key1", "key2"});
client.send(request);
} catch (Exception e) {
fail("Exception occurred while processing delete request");
}
try {
Request request = AppDataService.getAppData();
Response response = client.send(request);
AppData data = response.getEntry();
assertTrue(data.hasField(ORKUT_ID));
assertTrue(data.getDataForUser(ORKUT_ID, "key1") == null);
assertTrue(data.getDataForUser(ORKUT_ID, "key2") == null);
assertTrue(data.getDataForUser(ORKUT_ID, "java") != null);
} catch (Exception e) {
fail("Exception occurred while processing retrieve request");
}
}