### Question:
AwsStackRequestHelper { public CreateStackRequest createCreateStackRequest(AuthenticatedContext ac, CloudStack stack, String cFStackName, String subnet, String cfTemplate) { return new CreateStackRequest() .withStackName(cFStackName) .withOnFailure(OnFailure.DO_NOTHING) .withTemplateBody(cfTemplate) .withTags(awsTaggingService.prepareCloudformationTags(ac, stack.getTags())) .withCapabilities(CAPABILITY_IAM) .withParameters(getStackParameters(ac, stack, cFStackName, subnet)); }  CreateStackRequest createCreateStackRequest(AuthenticatedContext ac, CloudStack stack, String cFStackName, String subnet, String cfTemplate); CreateStackRequest createCreateStackRequest(AuthenticatedContext ac, DatabaseStack stack, String cFStackName, String cfTemplate); UpdateStackRequest createUpdateStackRequest(AuthenticatedContext ac, CloudStack stack, String cFStackName, String cfTemplate); DeleteStackRequest createDeleteStackRequest(String cFStackName);  }### Answer:
@Test public void testCreateCreateStackRequestForCloudStack() { when(cloudContext.getLocation()).thenReturn(Location.location(Region.region("region"), new AvailabilityZone("az"))); DescribeImagesResult imagesResult = new DescribeImagesResult(); when(amazonEC2Client.describeImages(any(DescribeImagesRequest.class))) .thenReturn(imagesResult.withImages(new com.amazonaws.services.ec2.model.Image())); when(network.getStringParameter(anyString())).thenReturn(""); Collection<Tag> tags = Lists.newArrayList(new Tag().withKey("mytag").withValue("myvalue")); when(awsTaggingService.prepareCloudformationTags(authenticatedContext, cloudStack.getTags())).thenReturn(tags); CreateStackRequest createStackRequest = underTest.createCreateStackRequest(authenticatedContext, cloudStack, "stackName", "subnet", "template"); assertEquals("stackName", createStackRequest.getStackName()); assertEquals("template", createStackRequest.getTemplateBody()); verify(awsTaggingService).prepareCloudformationTags(authenticatedContext, cloudStack.getTags()); assertEquals(tags, createStackRequest.getTags()); }
@Test public void testCreateCreateStackRequestForDatabaseStack() { Collection<Tag> tags = Lists.newArrayList(new Tag().withKey("mytag").withValue("myvalue")); when(awsTaggingService.prepareCloudformationTags(authenticatedContext, databaseStack.getTags())).thenReturn(tags); CreateStackRequest createStackRequest = underTest.createCreateStackRequest(authenticatedContext, databaseStack, "stackName", "template"); assertEquals("stackName", createStackRequest.getStackName()); assertEquals("template", createStackRequest.getTemplateBody()); verify(awsTaggingService).prepareCloudformationTags(authenticatedContext, cloudStack.getTags()); assertEquals(tags, createStackRequest.getTags()); }