private static final Logger LOG = LoggerFactory.getLogger(DriveFilesIntegrationTest.class);
private static final String PATH_PREFIX = GoogleDriveApiCollection.getCollection().getApiName(DriveFilesApiMethod.class).getName();
@Test
public void testCopy() throws Exception {
File testFile = uploadTestFile();
String fromFileId = testFile.getId();
File toFile = new File();
toFile.setTitle(UPLOAD_FILE.getName() + "_copy");
final Map<String, Object> headers = new HashMap<String, Object>();
// parameter type is String
headers.put("CamelGoogleDrive.fileId", fromFileId);
// parameter type is com.google.api.services.drive.model.File
headers.put("CamelGoogleDrive.content", toFile);
final File result = requestBodyAndHeaders("direct://COPY", null, headers);
assertNotNull("copy result", result);
assertEquals(toFile.getTitle(), result.getTitle());
LOG.debug("copy: " + result);
}