@Test(expected = IllegalArgumentException.class) public void testGenerateImageIdShouldThrowExceptionWhenTheImageNameIsNull() { underTest.generateImageId(SUBSCRIPTION_ID, RESOURCE_GROUP, null); }
public String generateImageId(String subscriptionId, String resourceGroup, String imageName) { Assert.hasText(subscriptionId, "Subscription id must not be null or empty."); Assert.hasText(resourceGroup, "Resource group must not be null or empty."); Assert.hasText(imageName, "Image name must not be null or empty."); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("/subscriptions/"); stringBuilder.append(subscriptionId); stringBuilder.append("/resourceGroups/"); stringBuilder.append(resourceGroup); stringBuilder.append("/providers/Microsoft.Compute/"); stringBuilder.append(AzureStorage.IMAGES_CONTAINER); stringBuilder.append("/"); stringBuilder.append(imageName); String resourceReference = stringBuilder.toString(); LOGGER.info("Generated resourceReferenceId: {}", resourceReference); return resourceReference; }
AzureImageIdProviderService { public String generateImageId(String subscriptionId, String resourceGroup, String imageName) { Assert.hasText(subscriptionId, "Subscription id must not be null or empty."); Assert.hasText(resourceGroup, "Resource group must not be null or empty."); Assert.hasText(imageName, "Image name must not be null or empty."); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("/subscriptions/"); stringBuilder.append(subscriptionId); stringBuilder.append("/resourceGroups/"); stringBuilder.append(resourceGroup); stringBuilder.append("/providers/Microsoft.Compute/"); stringBuilder.append(AzureStorage.IMAGES_CONTAINER); stringBuilder.append("/"); stringBuilder.append(imageName); String resourceReference = stringBuilder.toString(); LOGGER.info("Generated resourceReferenceId: {}", resourceReference); return resourceReference; } }
AzureImageIdProviderService { public String generateImageId(String subscriptionId, String resourceGroup, String imageName) { Assert.hasText(subscriptionId, "Subscription id must not be null or empty."); Assert.hasText(resourceGroup, "Resource group must not be null or empty."); Assert.hasText(imageName, "Image name must not be null or empty."); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("/subscriptions/"); stringBuilder.append(subscriptionId); stringBuilder.append("/resourceGroups/"); stringBuilder.append(resourceGroup); stringBuilder.append("/providers/Microsoft.Compute/"); stringBuilder.append(AzureStorage.IMAGES_CONTAINER); stringBuilder.append("/"); stringBuilder.append(imageName); String resourceReference = stringBuilder.toString(); LOGGER.info("Generated resourceReferenceId: {}", resourceReference); return resourceReference; }  }
AzureImageIdProviderService { public String generateImageId(String subscriptionId, String resourceGroup, String imageName) { Assert.hasText(subscriptionId, "Subscription id must not be null or empty."); Assert.hasText(resourceGroup, "Resource group must not be null or empty."); Assert.hasText(imageName, "Image name must not be null or empty."); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("/subscriptions/"); stringBuilder.append(subscriptionId); stringBuilder.append("/resourceGroups/"); stringBuilder.append(resourceGroup); stringBuilder.append("/providers/Microsoft.Compute/"); stringBuilder.append(AzureStorage.IMAGES_CONTAINER); stringBuilder.append("/"); stringBuilder.append(imageName); String resourceReference = stringBuilder.toString(); LOGGER.info("Generated resourceReferenceId: {}", resourceReference); return resourceReference; }  String generateImageId(String subscriptionId, String resourceGroup, String imageName); }
AzureImageIdProviderService { public String generateImageId(String subscriptionId, String resourceGroup, String imageName) { Assert.hasText(subscriptionId, "Subscription id must not be null or empty."); Assert.hasText(resourceGroup, "Resource group must not be null or empty."); Assert.hasText(imageName, "Image name must not be null or empty."); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("/subscriptions/"); stringBuilder.append(subscriptionId); stringBuilder.append("/resourceGroups/"); stringBuilder.append(resourceGroup); stringBuilder.append("/providers/Microsoft.Compute/"); stringBuilder.append(AzureStorage.IMAGES_CONTAINER); stringBuilder.append("/"); stringBuilder.append(imageName); String resourceReference = stringBuilder.toString(); LOGGER.info("Generated resourceReferenceId: {}", resourceReference); return resourceReference; }  String generateImageId(String subscriptionId, String resourceGroup, String imageName);  }