@Test public void shouldDeleteSasLogicalInterconnectGroup() { client.delete(ANY_RESOURCE_ID, TaskTimeout.of(321)); String expectedUri = SAS_LOGICAL_INTERCONNECT_GROUP_URI + "/" + ANY_RESOURCE_ID; Request expectedRequest = new Request(HttpMethod.DELETE, expectedUri); expectedRequest.setTimeout(321); then(baseClient).should().executeMonitorableRequest(expectedRequest); }
@Test public void shouldCreateSasLogicalInterconnectGroup() { SasLogicalInterconnectGroup group = new SasLogicalInterconnectGroup(); client.create(group, TaskTimeout.of(321)); Request expectedRequest = new Request(HttpMethod.POST, SAS_LOGICAL_INTERCONNECT_GROUP_URI, group); expectedRequest.setTimeout(321); then(baseClient).should().executeMonitorableRequest(expectedRequest); }
@Test public void shouldExtractBundle() { client.extractBundle(ANY_RESOURCE_ID, TaskTimeout.of(123)); String expectedUri = ARTIFACTS_BUNDLE_URI + "/" + ANY_RESOURCE_ID; Request expectedRequest = new Request(HttpMethod.PUT, expectedUri, ""); expectedRequest.setContentType(ContentType.TEXT_PLAIN); expectedRequest.setTimeout(123); then(baseClient).should().executeMonitorableRequest(expectedRequest); }
@Test public void shouldCreateBackupBundle() { UserBackupParams userBackupParams = new UserBackupParams(); client.createBackupBundle(userBackupParams, TaskTimeout.of(123)); String expectedUri = ARTIFACTS_BUNDLE_URI + ARTIFACTS_BUNDLE_BACKUPS_URI; Request expectedRequest = new Request(HttpMethod.POST, expectedUri, userBackupParams); expectedRequest.setTimeout(123); then(baseClient).should().executeMonitorableRequest(expectedRequest); }
@Test public void shouldCreateArtifactsBundle() { CreateArtifactsBundle artifactsBundle = new CreateArtifactsBundle(); client.create(artifactsBundle, TaskTimeout.of(123)); Request expectedRequest = new Request(HttpMethod.POST, ARTIFACTS_BUNDLE_URI, artifactsBundle); expectedRequest.setTimeout(123); then(baseClient).should().executeMonitorableRequest(expectedRequest); }
@Test public void shouldGetArtifactsBundleCollectionByName() { client.getByName(ANY_RESOURCE_NAME); Request expectedRequest = new Request(HttpMethod.GET, ARTIFACTS_BUNDLE_URI); expectedRequest.addQuery(UrlParameter.getFilterByNameParameter(ANY_RESOURCE_NAME)); then(baseClient) .should() .executeRequest( expectedRequest, new TypeToken<ResourceCollection<ArtifactsBundle>>() {}.getType()); }
@Test public void shouldExtractBackupBundle() { UserBackupParams userBackupParams = new UserBackupParams(); client.extractBackupBundle(ANY_RESOURCE_ID, userBackupParams, TaskTimeout.of(123)); String expectedUri = ARTIFACTS_BUNDLE_URI + ARTIFACTS_BUNDLE_BACKUPS_URI + "/" + ANY_RESOURCE_ID; Request expectedRequest = new Request(HttpMethod.PUT, expectedUri, userBackupParams); expectedRequest.setTimeout(123); then(baseClient).should().executeMonitorableRequest(expectedRequest); }
@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 shouldGetSasLogicalInterconnectGroupsByName() { client.getByName(ANY_RESOURCE_NAME); Request expectedRequest = new Request(HttpMethod.GET, SAS_LOGICAL_INTERCONNECT_GROUP_URI); expectedRequest.addQuery(UrlParameter.getFilterByNameParameter(ANY_RESOURCE_NAME)); then(baseClient) .should() .executeRequest( expectedRequest, new TypeToken<ResourceCollection<SasLogicalInterconnectGroup>>() {}.getType()); }
@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); }