@Test public void testImageStorageNameForNonSingleRG() { ReflectionTestUtils.setField(underTest, "imageStorePrefix", "cbimg"); CloudCredential cloudCredential = createCloudCredential(); AzureCredentialView azureCredentialView = new AzureCredentialView(cloudCredential); CloudContext cloudContext = createCloudContext(); when(azureResourceGroupMetadataProvider.useSingleResourceGroup(cloudStack)).thenReturn(false); String imageStorageName = underTest.getImageStorageName(azureCredentialView, cloudContext, cloudStack); assertEquals("cbimgwu2subscriptionone", imageStorageName); }
public String getImageStorageName(AzureCredentialView acv, CloudContext cloudContext, CloudStack cloudStack) { if (azureResourceGroupMetadataProvider.useSingleResourceGroup(cloudStack)) { String resourceGroupName = azureResourceGroupMetadataProvider.getResourceGroupName(cloudContext, cloudStack); return getPersistentStorageName(imageStorePrefix, acv, cloudContext.getLocation().getRegion().value(), resourceGroupName); } else { return getPersistentStorageName(imageStorePrefix, acv, cloudContext.getLocation().getRegion().value(), null); } }
AzureStorage { public String getImageStorageName(AzureCredentialView acv, CloudContext cloudContext, CloudStack cloudStack) { if (azureResourceGroupMetadataProvider.useSingleResourceGroup(cloudStack)) { String resourceGroupName = azureResourceGroupMetadataProvider.getResourceGroupName(cloudContext, cloudStack); return getPersistentStorageName(imageStorePrefix, acv, cloudContext.getLocation().getRegion().value(), resourceGroupName); } else { return getPersistentStorageName(imageStorePrefix, acv, cloudContext.getLocation().getRegion().value(), null); } } }
AzureStorage { public String getImageStorageName(AzureCredentialView acv, CloudContext cloudContext, CloudStack cloudStack) { if (azureResourceGroupMetadataProvider.useSingleResourceGroup(cloudStack)) { String resourceGroupName = azureResourceGroupMetadataProvider.getResourceGroupName(cloudContext, cloudStack); return getPersistentStorageName(imageStorePrefix, acv, cloudContext.getLocation().getRegion().value(), resourceGroupName); } else { return getPersistentStorageName(imageStorePrefix, acv, cloudContext.getLocation().getRegion().value(), null); } }  }
AzureStorage { public String getImageStorageName(AzureCredentialView acv, CloudContext cloudContext, CloudStack cloudStack) { if (azureResourceGroupMetadataProvider.useSingleResourceGroup(cloudStack)) { String resourceGroupName = azureResourceGroupMetadataProvider.getResourceGroupName(cloudContext, cloudStack); return getPersistentStorageName(imageStorePrefix, acv, cloudContext.getLocation().getRegion().value(), resourceGroupName); } else { return getPersistentStorageName(imageStorePrefix, acv, cloudContext.getLocation().getRegion().value(), null); } }  ArmAttachedStorageOption getArmAttachedStorageOption(Map<String, String> parameters); AzureImage getCustomImage(AzureClient client, AuthenticatedContext ac, CloudStack stack); AzureImage getCustomImage(AzureClient client, AuthenticatedContext ac, CloudStack stack, String imageName); String getImageStorageName(AzureCredentialView acv, CloudContext cloudContext, CloudStack cloudStack); String getAttachedDiskStorageName(ArmAttachedStorageOption armAttachedStorageOption, AzureCredentialView acv, Long vmId, CloudContext cloudContext,
            AzureDiskType storageType); StorageAccount createStorage(AzureClient client, String osStorageName, AzureDiskType storageType, String storageGroup,
            String region, Boolean encrypted, Map<String, String> tags); void deleteStorage(AzureClient client, String osStorageName, String storageGroup); String getDiskContainerName(CloudContext cloudContext); String getPersistentStorageName(CloudStack stack); Boolean isEncrytionNeeded(Map<String, String> parameters); boolean isPersistentStorage(String persistentStorageName); Optional<String> findStorageAccountIdInVisibleSubscriptions(AzureClient client, String account); }
AzureStorage { public String getImageStorageName(AzureCredentialView acv, CloudContext cloudContext, CloudStack cloudStack) { if (azureResourceGroupMetadataProvider.useSingleResourceGroup(cloudStack)) { String resourceGroupName = azureResourceGroupMetadataProvider.getResourceGroupName(cloudContext, cloudStack); return getPersistentStorageName(imageStorePrefix, acv, cloudContext.getLocation().getRegion().value(), resourceGroupName); } else { return getPersistentStorageName(imageStorePrefix, acv, cloudContext.getLocation().getRegion().value(), null); } }  ArmAttachedStorageOption getArmAttachedStorageOption(Map<String, String> parameters); AzureImage getCustomImage(AzureClient client, AuthenticatedContext ac, CloudStack stack); AzureImage getCustomImage(AzureClient client, AuthenticatedContext ac, CloudStack stack, String imageName); String getImageStorageName(AzureCredentialView acv, CloudContext cloudContext, CloudStack cloudStack); String getAttachedDiskStorageName(ArmAttachedStorageOption armAttachedStorageOption, AzureCredentialView acv, Long vmId, CloudContext cloudContext,
            AzureDiskType storageType); StorageAccount createStorage(AzureClient client, String osStorageName, AzureDiskType storageType, String storageGroup,
            String region, Boolean encrypted, Map<String, String> tags); void deleteStorage(AzureClient client, String osStorageName, String storageGroup); String getDiskContainerName(CloudContext cloudContext); String getPersistentStorageName(CloudStack stack); Boolean isEncrytionNeeded(Map<String, String> parameters); boolean isPersistentStorage(String persistentStorageName); Optional<String> findStorageAccountIdInVisibleSubscriptions(AzureClient client, String account); static final String IMAGES_CONTAINER; static final String STORAGE_BLOB_PATTERN; }