use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request in project cloudbreak by hortonworks.
the class StackRequestManifesterTest method setupInstanceVolumeEncryptionTestWhenAwsAndTwoInstanceGroupsAndEncryptionTypesNoneCustom.
@Test
void setupInstanceVolumeEncryptionTestWhenAwsAndTwoInstanceGroupsAndEncryptionTypesNoneCustom() {
DetailedEnvironmentResponse envResponse = new DetailedEnvironmentResponse();
envResponse.setCloudPlatform(CloudPlatform.AWS.name());
InstanceGroupV4Request instanceGroupV4Request1 = createInstanceGroupV4Request();
InstanceTemplateV4Request instanceTemplateV4Request1 = instanceGroupV4Request1.getTemplate();
instanceTemplateV4Request1.createAws().setEncryption(createAwsEncryptionV4Parameters(EncryptionType.NONE));
InstanceGroupV4Request instanceGroupV4Request2 = createInstanceGroupV4Request();
InstanceTemplateV4Request instanceTemplateV4Request2 = instanceGroupV4Request2.getTemplate();
instanceTemplateV4Request2.createAws().setEncryption(createAwsEncryptionV4Parameters(EncryptionType.CUSTOM, ENCRYPTION_KEY));
when(stackV4Request.getInstanceGroups()).thenReturn(List.of(instanceGroupV4Request1, instanceGroupV4Request2));
underTest.setupInstanceVolumeEncryption(stackV4Request, envResponse);
verifyAwsEncryption(instanceTemplateV4Request1, EncryptionType.NONE);
verifyAwsEncryption(instanceTemplateV4Request2, EncryptionType.CUSTOM, ENCRYPTION_KEY);
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request in project cloudbreak by hortonworks.
the class StackRequestManifesterTest method setupInstanceVolumeEncryptionTestWhenGcpAndEncryptionKeyAndTwoInstanceGroups.
@Test
void setupInstanceVolumeEncryptionTestWhenGcpAndEncryptionKeyAndTwoInstanceGroups() {
DetailedEnvironmentResponse envResponse = new DetailedEnvironmentResponse();
envResponse.setGcp(GcpEnvironmentParameters.builder().withResourceEncryptionParameters(GcpResourceEncryptionParameters.builder().withEncryptionKey(ENCRYPTION_KEY).build()).build());
envResponse.setCloudPlatform(CloudPlatform.GCP.name());
InstanceGroupV4Request instanceGroupV4Request1 = createInstanceGroupV4Request();
InstanceTemplateV4Request instanceTemplateV4Request1 = instanceGroupV4Request1.getTemplate();
InstanceGroupV4Request instanceGroupV4Request2 = createInstanceGroupV4Request();
InstanceTemplateV4Request instanceTemplateV4Request2 = instanceGroupV4Request2.getTemplate();
instanceTemplateV4Request2.createGcp().setEncryption(createGcpEncryptionV4Parameters(EncryptionType.CUSTOM, ENCRYPTION_KEY));
when(stackV4Request.getInstanceGroups()).thenReturn(List.of(instanceGroupV4Request1, instanceGroupV4Request2));
underTest.setupInstanceVolumeEncryption(stackV4Request, envResponse);
verifyGcpEncryption(instanceTemplateV4Request1, EncryptionType.CUSTOM, ENCRYPTION_KEY);
verifyGcpEncryption(instanceTemplateV4Request2, EncryptionType.CUSTOM, ENCRYPTION_KEY);
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request in project cloudbreak by hortonworks.
the class StackRequestManifesterTest method setupInstanceVolumeEncryptionTestWhenAzureAndEncryptionAtHostAndNoInstanceTemplateParameters.
@Test
void setupInstanceVolumeEncryptionTestWhenAzureAndEncryptionAtHostAndNoInstanceTemplateParameters() {
DetailedEnvironmentResponse envResponse = new DetailedEnvironmentResponse();
envResponse.setAccountId(ACCOUNT_ID);
envResponse.setCloudPlatform(CloudPlatform.AZURE.name());
when(entitlementService.isAzureEncryptionAtHostEnabled(ACCOUNT_ID)).thenReturn(Boolean.TRUE);
InstanceGroupV4Request instanceGroupV4Request = createInstanceGroupV4Request();
when(stackV4Request.getInstanceGroups()).thenReturn(List.of(instanceGroupV4Request));
underTest.setupInstanceVolumeEncryption(stackV4Request, envResponse);
verifyAzureEncryptionForEncryptionAtHost(instanceGroupV4Request.getTemplate(), Boolean.TRUE);
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request in project cloudbreak by hortonworks.
the class StackRequestManifesterTest method setupInstanceVolumeEncryptionTestWhenAzureAndDiskEncryptionSetIdAndNoInstanceTemplateParameters.
@Test
void setupInstanceVolumeEncryptionTestWhenAzureAndDiskEncryptionSetIdAndNoInstanceTemplateParameters() {
DetailedEnvironmentResponse envResponse = new DetailedEnvironmentResponse();
envResponse.setCloudPlatform(CloudPlatform.AZURE.name());
envResponse.setAzure(AzureEnvironmentParameters.builder().withResourceEncryptionParameters(AzureResourceEncryptionParameters.builder().withDiskEncryptionSetId(DISK_ENCRYPTION_SET_ID).withEncryptionKeyUrl(ENCRYPTION_KEY).build()).build());
InstanceGroupV4Request instanceGroupV4Request = createInstanceGroupV4Request();
when(stackV4Request.getInstanceGroups()).thenReturn(List.of(instanceGroupV4Request));
underTest.setupInstanceVolumeEncryption(stackV4Request, envResponse);
verifyAzureEncryption(instanceGroupV4Request.getTemplate(), EncryptionType.CUSTOM, DISK_ENCRYPTION_SET_ID, ENCRYPTION_KEY);
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request in project cloudbreak by hortonworks.
the class StackRequestManifesterTest method setupInstanceVolumeEncryptionTestWhenGcpAndEncryptionKeyAndNoInstanceTemplateParameters.
@Test
void setupInstanceVolumeEncryptionTestWhenGcpAndEncryptionKeyAndNoInstanceTemplateParameters() {
DetailedEnvironmentResponse envResponse = new DetailedEnvironmentResponse();
envResponse.setCloudPlatform(CloudPlatform.GCP.name());
envResponse.setGcp(GcpEnvironmentParameters.builder().withResourceEncryptionParameters(GcpResourceEncryptionParameters.builder().withEncryptionKey(ENCRYPTION_KEY).build()).build());
InstanceGroupV4Request instanceGroupV4Request = createInstanceGroupV4Request();
when(stackV4Request.getInstanceGroups()).thenReturn(List.of(instanceGroupV4Request));
underTest.setupInstanceVolumeEncryption(stackV4Request, envResponse);
verifyGcpEncryption(instanceGroupV4Request.getTemplate(), EncryptionType.CUSTOM, ENCRYPTION_KEY);
}
Aggregations