use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.instance.InstanceTemplateRequest in project cloudbreak by hortonworks.
the class InstanceTemplateRequestToTemplateConverterTest method shouldSetEncryptionKeyAndEncryptionMethodPropertyWhenCustomAwsEncryptionKeyPresent.
@Test
void shouldSetEncryptionKeyAndEncryptionMethodPropertyWhenCustomAwsEncryptionKeyPresent() {
InstanceTemplateRequest source = new InstanceTemplateRequest();
source.setInstanceType(INSTANCE_TYPE);
Template result = underTest.convert(source, CloudPlatform.AWS, ACCOUNT_ID, null, null, "dummyAwsEncryptionKeyArn");
Json attributes = result.getAttributes();
assertThat(attributes).isNotNull();
assertThat(attributes.<Object>getValue(GcpInstanceTemplate.VOLUME_ENCRYPTION_KEY_ID)).isEqualTo("dummyAwsEncryptionKeyArn");
assertThat(attributes.<Object>getValue(InstanceTemplate.VOLUME_ENCRYPTION_KEY_TYPE)).isEqualTo(EncryptionType.CUSTOM.name());
}
use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.instance.InstanceTemplateRequest in project cloudbreak by hortonworks.
the class InstanceTemplateRequestToTemplateConverterTest method shouldSetSpotPercentagePropertyWhenProvided.
@Test
void shouldSetSpotPercentagePropertyWhenProvided() {
InstanceTemplateRequest source = new InstanceTemplateRequest();
source.setInstanceType(INSTANCE_TYPE);
source.setAws(createAwsInstanceTemplateParameters(SPOT_PERCENTAGE, SPOT_MAX_PRICE));
Template result = underTest.convert(source, CLOUD_PLATFORM, ACCOUNT_ID, null, null, null);
Json attributes = result.getAttributes();
assertThat(attributes).isNotNull();
assertThat(attributes.<Object>getValue(AwsInstanceTemplate.EC2_SPOT_PERCENTAGE)).isEqualTo(SPOT_PERCENTAGE);
assertThat(attributes.<Object>getValue(AwsInstanceTemplate.EC2_SPOT_MAX_PRICE)).isEqualTo(SPOT_MAX_PRICE);
}
use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.instance.InstanceTemplateRequest in project cloudbreak by hortonworks.
the class InstanceTemplateRequestToTemplateConverterTest method shouldNotSetVolumeEncryptionWhenAzure.
@Test
void shouldNotSetVolumeEncryptionWhenAzure() {
InstanceTemplateRequest source = new InstanceTemplateRequest();
source.setInstanceType(INSTANCE_TYPE);
Template result = underTest.convert(source, CloudPlatform.AZURE, ACCOUNT_ID, null, null, null);
Json attributes = result.getAttributes();
assertThat(attributes).isNotNull();
assertThat(attributes.<Object>getValue(AwsInstanceTemplate.EBS_ENCRYPTION_ENABLED)).isNull();
assertThat(attributes.<Object>getValue(InstanceTemplate.VOLUME_ENCRYPTION_KEY_TYPE)).isNull();
}
use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.instance.InstanceTemplateRequest in project cloudbreak by hortonworks.
the class InstanceTemplateRequestToTemplateConverterTest method shouldSetAccoundIdWhenProvided.
@Test
void shouldSetAccoundIdWhenProvided() {
InstanceTemplateRequest source = new InstanceTemplateRequest();
source.setInstanceType(INSTANCE_TYPE);
Template result = underTest.convert(source, CLOUD_PLATFORM, ACCOUNT_ID, null, null, null);
assertThat(result.getAccountId()).isEqualTo(ACCOUNT_ID);
}
Aggregations