@Test
// also tests create folder, and delete folder
public void testCopyFolder() throws Exception {
// create a test folder to copy
final BoxFolder testFolder = createFolder();
try {
final Map<String, Object> headers = new HashMap<String, Object>();
// parameter type is String
headers.put("CamelBox.folderId", testFolder.getId());
// parameter type is com.box.boxjavalibv2.requests.requestobjects.BoxItemCopyRequestObject
final BoxItemCopyRequestObject requestObject = BoxItemCopyRequestObject.copyItemRequestObject("0");
requestObject.setName(CAMEL_TEST_COPY_FOLDER);
headers.put("CamelBox.itemCopyRequest", requestObject);
BoxFolder result = requestBodyAndHeaders("direct://COPYFOLDER", null, headers);
assertNotNull("copyFolder result", result);
assertEquals("copyFolder folder name", CAMEL_TEST_COPY_FOLDER, result.getName());
LOG.debug("copyFolder: " + result);
// delete the copy
deleteFolder(result.getId());
} finally {
deleteFolder(testFolder.getId());
}
}