### Question:
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);  }### Answer:
@Test public void testGenerateImageIdShouldCreateImageId() { String expected = "/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/images/image-name"; String actual = underTest.generateImageId(SUBSCRIPTION_ID, RESOURCE_GROUP, IMAGE_NAME); Assert.assertEquals(expected, actual); }
@Test(expected = IllegalArgumentException.class) public void testGenerateImageIdShouldThrowExceptionWhenTheSubscriptionIdIsNull() { underTest.generateImageId(null, RESOURCE_GROUP, IMAGE_NAME); }
@Test(expected = IllegalArgumentException.class) public void testGenerateImageIdShouldThrowExceptionWhenResourceGroupIsNull() { underTest.generateImageId(SUBSCRIPTION_ID, null, IMAGE_NAME); }
@Test(expected = IllegalArgumentException.class) public void testGenerateImageIdShouldThrowExceptionWhenTheImageNameIsNull() { underTest.generateImageId(SUBSCRIPTION_ID, RESOURCE_GROUP, null); }