@Test public void shouldCreateArtifactsBundleFromFile() { File file = new File(ANY_FILE_PATH); client.create(file, DownloadPath.at(ANY_FILE_PATH)); Request expectedRequest = new Request(HttpMethod.POST, ARTIFACTS_BUNDLE_URI, file); expectedRequest.setDownloadPath(ANY_FILE_PATH); expectedRequest.setContentType(ContentType.MULTIPART_FORM_DATA); expectedRequest.setForceReturnTask(true); then(baseClient).should().executeMonitorableRequest(expectedRequest); }
@Test public void shouldCreateBackupArchiveBundle() { File file = new File(ANY_FILE_PATH); String deploymentGrpUri = DeploymentGroupClient.DEPLOYMENT_GROUP_URI + "/" + DEPLOYMENT_GROUP_RESOURCE_ID; UrlParameter query = new UrlParameter("deploymentGrpUri", deploymentGrpUri); client.createBackupArchiveBundle(file, deploymentGrpUri, DownloadPath.at(ANY_FILE_PATH)); String expectedUri = ARTIFACTS_BUNDLE_URI + ARTIFACTS_BUNDLE_BACKUPS_URI + ARTIFACTS_BUNDLE_ARCHIVE_URI; Request expectedRequest = new Request(HttpMethod.POST, expectedUri, file); expectedRequest.addQuery(query); expectedRequest.setDownloadPath(ANY_FILE_PATH); expectedRequest.setContentType(ContentType.MULTIPART_FORM_DATA); expectedRequest.setForceReturnTask(true); then(baseClient).should().executeMonitorableRequest(expectedRequest); }