@Test public void shouldAdjustResourceNameLengthIfItsTooLong() { CloudContext context = new CloudContext(7899L, "thisisaverylongazureresourcenamewhichneedstobeshortened", "dummy1", USER_ID, WORKSPACE_ID); String testResult = underTest.getStackName(context); Assert.assertNotNull("The generated name must not be null!", testResult); assertEquals("The resource name is not the excepted one!", "thisisaverylongazureresourcenamewhichneedstobe7899", testResult); assertEquals("The resource name length is wrong", testResult.length(), Integer.parseInt(MAX_RESOURCE_NAME_LENGTH)); }
public String getStackName(CloudContext cloudContext) { return generateResourceGroupNameByNameAndId(cloudContext.getName(), cloudContext.getId().toString()); }
AzureUtils { public String getStackName(CloudContext cloudContext) { return generateResourceGroupNameByNameAndId(cloudContext.getName(), cloudContext.getId().toString()); } }
AzureUtils { public String getStackName(CloudContext cloudContext) { return generateResourceGroupNameByNameAndId(cloudContext.getName(), cloudContext.getId().toString()); }  }
AzureUtils { public String getStackName(CloudContext cloudContext) { return generateResourceGroupNameByNameAndId(cloudContext.getName(), cloudContext.getId().toString()); }  CloudResource getTemplateResource(Iterable<CloudResource> resourceList); static String getGroupName(String group); static void removeBlankSpace(StringBuilder sb); String getLoadBalancerId(String stackName); String getPrivateInstanceId(String stackName, String groupName, String privateId); String getStackName(CloudContext cloudContext); String generateResourceGroupNameByNameAndId(String name, String id); CloudResourceStatus getTemplateStatus(CloudResource resource, Deployment templateDeployment, AzureClient access, String stackName); boolean isExistingNetwork(Network network); String getInstanceName(CloudResource resource); boolean isPrivateIp(Network network); List<CloudInstance> getInstanceList(CloudStack stack); String getCustomNetworkId(Network network); String getCustomResourceGroupName(Network network); List<String> getCustomSubnetIds(Network network); void validateSubnet(AzureClient client, Network network); void validateStorageType(CloudStack stack); void validateStorageTypeForGroup(AzureDiskType diskType, String flavor); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) List<CloudVmInstanceStatus> deallocateInstances(AuthenticatedContext ac, List<CloudInstance> vms); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) List<CloudVmInstanceStatus> deleteInstances(AuthenticatedContext ac, List<CloudInstance> vms); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) void waitForDetachNetworkInterfaces(AuthenticatedContext authenticatedContext, AzureClient azureClient, String resourceGroupName,
            Collection<String> networkInterfaceNames); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) void deleteNetworkInterfaces(AzureClient azureClient, String resourceGroupName, Collection<String> networkInterfaceNames); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) void deletePublicIps(AzureClient azureClient, String resourceGroupName, Collection<String> publicIpNames); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) void deleteAvailabilitySets(AzureClient azureClient, String resourceGroupName, Collection<String> availabilitySetNames); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) void deleteSecurityGroups(AzureClient azureClient, Collection<String> securityGroupIds); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) void deleteNetworks(AzureClient azureClient, Collection<String> networkIds); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) void deleteStorageAccounts(AzureClient azureClient, Collection<String> accountIds); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) void deleteImages(AzureClient azureClient, Collection<String> imageIds); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) Optional<String> deleteDatabaseServer(AzureClient azureClient, String databaseServerId, boolean cancelException); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) Optional<String> deleteResourceGroup(AzureClient azureClient, String resourceGroupId, boolean cancelException); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) void deleteManagedDisks(AzureClient azureClient, Collection<String> managedDiskIds); void checkResourceGroupExistence(AzureClient client, String resourceGroupName); CloudConnectorException convertToCloudConnectorException(CloudException e, String actionDescription); }
AzureUtils { public String getStackName(CloudContext cloudContext) { return generateResourceGroupNameByNameAndId(cloudContext.getName(), cloudContext.getId().toString()); }  CloudResource getTemplateResource(Iterable<CloudResource> resourceList); static String getGroupName(String group); static void removeBlankSpace(StringBuilder sb); String getLoadBalancerId(String stackName); String getPrivateInstanceId(String stackName, String groupName, String privateId); String getStackName(CloudContext cloudContext); String generateResourceGroupNameByNameAndId(String name, String id); CloudResourceStatus getTemplateStatus(CloudResource resource, Deployment templateDeployment, AzureClient access, String stackName); boolean isExistingNetwork(Network network); String getInstanceName(CloudResource resource); boolean isPrivateIp(Network network); List<CloudInstance> getInstanceList(CloudStack stack); String getCustomNetworkId(Network network); String getCustomResourceGroupName(Network network); List<String> getCustomSubnetIds(Network network); void validateSubnet(AzureClient client, Network network); void validateStorageType(CloudStack stack); void validateStorageTypeForGroup(AzureDiskType diskType, String flavor); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) List<CloudVmInstanceStatus> deallocateInstances(AuthenticatedContext ac, List<CloudInstance> vms); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) List<CloudVmInstanceStatus> deleteInstances(AuthenticatedContext ac, List<CloudInstance> vms); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) void waitForDetachNetworkInterfaces(AuthenticatedContext authenticatedContext, AzureClient azureClient, String resourceGroupName,
            Collection<String> networkInterfaceNames); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) void deleteNetworkInterfaces(AzureClient azureClient, String resourceGroupName, Collection<String> networkInterfaceNames); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) void deletePublicIps(AzureClient azureClient, String resourceGroupName, Collection<String> publicIpNames); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) void deleteAvailabilitySets(AzureClient azureClient, String resourceGroupName, Collection<String> availabilitySetNames); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) void deleteSecurityGroups(AzureClient azureClient, Collection<String> securityGroupIds); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) void deleteNetworks(AzureClient azureClient, Collection<String> networkIds); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) void deleteStorageAccounts(AzureClient azureClient, Collection<String> accountIds); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) void deleteImages(AzureClient azureClient, Collection<String> imageIds); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) Optional<String> deleteDatabaseServer(AzureClient azureClient, String databaseServerId, boolean cancelException); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) Optional<String> deleteResourceGroup(AzureClient azureClient, String resourceGroupId, boolean cancelException); @Retryable(backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000), maxAttempts = 5) void deleteManagedDisks(AzureClient azureClient, Collection<String> managedDiskIds); void checkResourceGroupExistence(AzureClient client, String resourceGroupName); CloudConnectorException convertToCloudConnectorException(CloudException e, String actionDescription); static final String RG_NAME; static final String NETWORK_ID; }