@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 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); }