use of com.amazonaws.services.elasticfilesystem.AmazonElasticFileSystemClient in project cloudbreak by hortonworks.
the class AwsLaunchTest method launchStackWithEfs.
@Test
public void launchStackWithEfs() throws Exception {
setup();
setupRetryService();
setupFreemarkerTemplateProcessing();
setupDescribeStacksResponses();
setupDescribeImagesResponse();
setupDescribeStackResourceResponse();
setupAutoscalingResponses();
setupDescribeInstancesResponse();
setupCreateVolumeResponse();
setupDescribeVolumeResponse();
setupDescribeSubnetResponse();
setupDescribePrefixListsResponse();
setupCreateFileSystem();
setupDescribeFileSystems();
setupDescribeMountTargets();
setupDeleteMountTarget();
setupDeleteFileSystem();
InMemoryStateStore.putStack(1L, PollGroup.POLLABLE);
AuthenticatedContext authenticatedContext = componentTestUtil.getAuthenticatedContext();
authenticatedContext.putParameter(AmazonEc2Client.class, amazonEc2Client);
authenticatedContext.putParameter(AmazonElasticFileSystemClient.class, amazonElasticFileSystemClient);
authenticatedContext.putParameter(AmazonEfsClient.class, amazonEfsClient);
awsResourceConnector.launch(authenticatedContext, componentTestUtil.getStackForLaunch(InstanceStatus.CREATE_REQUESTED, InstanceStatus.CREATE_REQUESTED), persistenceNotifier, new AdjustmentTypeWithThreshold(AdjustmentType.EXACT, Long.MAX_VALUE));
// assert
verify(persistenceNotifier).notifyAllocation(argThat(cloudResource -> ResourceType.AWS_VPC.equals(cloudResource.getType())), any());
verify(persistenceNotifier, times(2)).notifyAllocation(argThat(cloudResource -> ResourceType.AWS_VOLUMESET.equals(cloudResource.getType())), any());
verify(persistenceNotifier).notifyAllocation(argThat(cloudResource -> ResourceType.AWS_SUBNET.equals(cloudResource.getType())), any());
verify(persistenceNotifier).notifyAllocation(argThat(cloudResource -> ResourceType.CLOUDFORMATION_STACK.equals(cloudResource.getType())), any());
InOrder inOrder = inOrder(amazonElasticFileSystemClient, amazonEfsClient, amazonCloudFormationClient, amazonEc2Client);
inOrder.verify(amazonEc2Client).describeImages(any());
inOrder.verify(amazonCloudFormationClient).createStack(any());
inOrder.verify(amazonEc2Client, times(2)).createVolume(any());
inOrder.verify(amazonEc2Client, times(2)).attachVolume(any());
inOrder.verify(amazonEc2Client, never()).describePrefixLists();
}
Aggregations