com.google.api.services.drive.model.CommentList result1 = requestBody("direct://LIST", fileId);
assertNotNull(result1.get("items"));
LOG.debug("list: " + result1);
Comment comment2 = result1.getItems().get(0);
// 4. now try and get that comment
headers = new HashMap<String, Object>();
// parameter type is String
headers.put("CamelGoogleDrive.fileId", fileId);
// parameter type is String
headers.put("CamelGoogleDrive.commentId", comment2.getCommentId());
final com.google.api.services.drive.model.Comment result3 = requestBodyAndHeaders("direct://GET", null, headers);
assertNotNull("get result", result3);
// 5. delete the comment
headers = new HashMap<String, Object>();
// parameter type is String
headers.put("CamelGoogleDrive.fileId", fileId);
// parameter type is String
headers.put("CamelGoogleDrive.commentId", comment2.getCommentId());
requestBodyAndHeaders("direct://DELETE", null, headers);
// 6. ensure the comment is gone
headers = new HashMap<String, Object>();
// parameter type is String
headers.put("CamelGoogleDrive.fileId", fileId);
// parameter type is String
headers.put("CamelGoogleDrive.commentId", comment2.getCommentId());
try {
final com.google.api.services.drive.model.Comment result4 = requestBodyAndHeaders("direct://GET", null, headers);
assertTrue("Should have thrown an exception.", false);
} catch (Exception e) {