use of com.sequenceiq.cloudbreak.common.mappable.ProviderParameterCalculator in project cloudbreak by hortonworks.
the class InstanceTemplateV4RequestToTemplateConverterTest method getSampleGcpRequest.
private InstanceTemplateV4Request getSampleGcpRequest() {
InstanceTemplateV4Request source = new InstanceTemplateV4Request();
source.setCloudPlatform(CloudPlatform.GCP);
source.setRootVolume(getRootVolume(100));
source.setInstanceType("n1-standard-4");
GcpInstanceTemplateV4Parameters parameters = new GcpInstanceTemplateV4Parameters();
GcpEncryptionV4Parameters encryption = new GcpEncryptionV4Parameters();
encryption.setType(EncryptionType.CUSTOM);
encryption.setKeyEncryptionMethod(KeyEncryptionMethod.RAW);
encryption.setKey("myKey");
parameters.setEncryption(encryption);
source.setGcp(parameters);
ProviderParameterCalculator providerParameterCalculator = new ProviderParameterCalculator();
ReflectionTestUtils.setField(underTest, "providerParameterCalculator", providerParameterCalculator);
when(missingResourceNameGenerator.generateName(APIResourceType.TEMPLATE)).thenReturn("name");
return source;
}
use of com.sequenceiq.cloudbreak.common.mappable.ProviderParameterCalculator in project cloudbreak by hortonworks.
the class InstanceTemplateV4RequestToTemplateConverterTest method getSampleAwsRequest.
private InstanceTemplateV4Request getSampleAwsRequest() {
InstanceTemplateV4Request source = new InstanceTemplateV4Request();
source.setCloudPlatform(CloudPlatform.AWS);
source.setRootVolume(getRootVolume(100));
source.setInstanceType("m5.2xlarge");
AwsInstanceTemplateV4Parameters parameters = new AwsInstanceTemplateV4Parameters();
AwsEncryptionV4Parameters encryption = new AwsEncryptionV4Parameters();
encryption.setType(EncryptionType.CUSTOM);
encryption.setKey("myKey");
parameters.setEncryption(encryption);
source.setAws(parameters);
ProviderParameterCalculator providerParameterCalculator = new ProviderParameterCalculator();
ReflectionTestUtils.setField(underTest, "providerParameterCalculator", providerParameterCalculator);
when(missingResourceNameGenerator.generateName(APIResourceType.TEMPLATE)).thenReturn("name");
return source;
}
Aggregations