Search in sources :

Example 1 with AttachedFreeIpaRequest

use of com.sequenceiq.environment.api.v1.environment.model.request.AttachedFreeIpaRequest in project cloudbreak by hortonworks.

the class EnvironmentApiConverterTest method createFreeIpaRequest.

private AttachedFreeIpaRequest createFreeIpaRequest() {
    AwsFreeIpaSpotParameters awsFreeIpaSpotParameters = new AwsFreeIpaSpotParameters();
    awsFreeIpaSpotParameters.setPercentage(50);
    awsFreeIpaSpotParameters.setMaxPrice(0.9);
    AwsFreeIpaParameters awsFreeIpaParameters = new AwsFreeIpaParameters();
    awsFreeIpaParameters.setSpot(awsFreeIpaSpotParameters);
    AttachedFreeIpaRequest attachedFreeIpaRequest = new AttachedFreeIpaRequest();
    attachedFreeIpaRequest.setAws(awsFreeIpaParameters);
    return attachedFreeIpaRequest;
}
Also used : AttachedFreeIpaRequest(com.sequenceiq.environment.api.v1.environment.model.request.AttachedFreeIpaRequest) AwsFreeIpaParameters(com.sequenceiq.environment.api.v1.environment.model.request.aws.AwsFreeIpaParameters) AwsFreeIpaSpotParameters(com.sequenceiq.environment.api.v1.environment.model.request.aws.AwsFreeIpaSpotParameters)

Example 2 with AttachedFreeIpaRequest

use of com.sequenceiq.environment.api.v1.environment.model.request.AttachedFreeIpaRequest in project cloudbreak by hortonworks.

the class FreeIpaConverterTest method testConvertWithInstanceType.

@Test
public void testConvertWithInstanceType() {
    // GIVEN
    AttachedFreeIpaRequest request = new AttachedFreeIpaRequest();
    request.setCreate(true);
    request.setInstanceType(INSTANCE_TYPE);
    // WHEN
    FreeIpaCreationDto result = underTest.convert(request, "id", CloudConstants.AWS);
    // THEN
    assertNotNull(result.getInstanceType());
    assertEquals(INSTANCE_TYPE, result.getInstanceType());
}
Also used : AttachedFreeIpaRequest(com.sequenceiq.environment.api.v1.environment.model.request.AttachedFreeIpaRequest) FreeIpaCreationDto(com.sequenceiq.environment.environment.dto.FreeIpaCreationDto) Test(org.junit.jupiter.api.Test)

Example 3 with AttachedFreeIpaRequest

use of com.sequenceiq.environment.api.v1.environment.model.request.AttachedFreeIpaRequest in project cloudbreak by hortonworks.

the class FreeIpaConverterTest method testConvertWithoutImage.

@Test
public void testConvertWithoutImage() {
    // GIVEN
    AttachedFreeIpaRequest request = new AttachedFreeIpaRequest();
    request.setCreate(true);
    request.setImage(null);
    // WHEN
    FreeIpaCreationDto result = underTest.convert(request, "id", CloudConstants.AWS);
    // THEN
    assertNull(result.getImageCatalog());
    assertNull(result.getImageId());
}
Also used : AttachedFreeIpaRequest(com.sequenceiq.environment.api.v1.environment.model.request.AttachedFreeIpaRequest) FreeIpaCreationDto(com.sequenceiq.environment.environment.dto.FreeIpaCreationDto) Test(org.junit.jupiter.api.Test)

Example 4 with AttachedFreeIpaRequest

use of com.sequenceiq.environment.api.v1.environment.model.request.AttachedFreeIpaRequest in project cloudbreak by hortonworks.

the class FreeIpaConverterTest method testConvertWithoutImageIdAndImageCatalog.

@Test
public void testConvertWithoutImageIdAndImageCatalog() {
    // GIVEN
    AttachedFreeIpaRequest request = new AttachedFreeIpaRequest();
    request.setCreate(true);
    request.setImage(aFreeIpaImage(null, null));
    // WHEN
    FreeIpaCreationDto result = underTest.convert(request, "id", CloudConstants.AWS);
    // THEN
    assertNull(result.getImageCatalog());
    assertNull(result.getImageId());
}
Also used : AttachedFreeIpaRequest(com.sequenceiq.environment.api.v1.environment.model.request.AttachedFreeIpaRequest) FreeIpaCreationDto(com.sequenceiq.environment.environment.dto.FreeIpaCreationDto) Test(org.junit.jupiter.api.Test)

Example 5 with AttachedFreeIpaRequest

use of com.sequenceiq.environment.api.v1.environment.model.request.AttachedFreeIpaRequest in project cloudbreak by hortonworks.

the class YarnCloudProvider method environment.

@Override
public EnvironmentTestDto environment(EnvironmentTestDto environment) {
    final AttachedFreeIpaRequest attachedFreeIpaRequest = new AttachedFreeIpaRequest();
    attachedFreeIpaRequest.setCreate(Boolean.FALSE);
    return environment.withLocation(location()).withFreeIpa(attachedFreeIpaRequest);
}
Also used : AttachedFreeIpaRequest(com.sequenceiq.environment.api.v1.environment.model.request.AttachedFreeIpaRequest)

Aggregations

AttachedFreeIpaRequest (com.sequenceiq.environment.api.v1.environment.model.request.AttachedFreeIpaRequest)8 FreeIpaCreationDto (com.sequenceiq.environment.environment.dto.FreeIpaCreationDto)5 Test (org.junit.jupiter.api.Test)4 AwsFreeIpaParameters (com.sequenceiq.environment.api.v1.environment.model.request.aws.AwsFreeIpaParameters)2 AwsFreeIpaSpotParameters (com.sequenceiq.environment.api.v1.environment.model.request.aws.AwsFreeIpaSpotParameters)2 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)1 FreeIpaImageRequest (com.sequenceiq.environment.api.v1.environment.model.request.FreeIpaImageRequest)1