Search in sources :

Example 6 with FreeIpaResponse

use of com.sequenceiq.environment.api.v1.environment.model.response.FreeIpaResponse in project cloudbreak by hortonworks.

the class FreeIpaConverter method convert.

public FreeIpaResponse convert(FreeIpaCreationDto freeIpaCreation) {
    if (freeIpaCreation == null) {
        return null;
    } else {
        FreeIpaResponse response = new FreeIpaResponse();
        response.setInstanceCountByGroup(freeIpaCreation.getInstanceCountByGroup());
        Optional.ofNullable(freeIpaCreation.getAws()).map(this::convertAws).ifPresent(response::setAws);
        response.setImage(convertImage(freeIpaCreation.getImageCatalog(), freeIpaCreation.getImageId()));
        response.setEnableMultiAz(freeIpaCreation.isEnableMultiAz());
        return response;
    }
}
Also used : FreeIpaResponse(com.sequenceiq.environment.api.v1.environment.model.response.FreeIpaResponse)

Example 7 with FreeIpaResponse

use of com.sequenceiq.environment.api.v1.environment.model.response.FreeIpaResponse in project cloudbreak by hortonworks.

the class FreeIpaConverterTest method testConvertWithNull.

@Test
public void testConvertWithNull() {
    // GIVEN
    FreeIpaCreationDto request = null;
    // WHEN
    FreeIpaResponse result = underTest.convert(request);
    // THEN
    assertNull(result);
}
Also used : FreeIpaCreationDto(com.sequenceiq.environment.environment.dto.FreeIpaCreationDto) FreeIpaResponse(com.sequenceiq.environment.api.v1.environment.model.response.FreeIpaResponse) Test(org.junit.jupiter.api.Test)

Example 8 with FreeIpaResponse

use of com.sequenceiq.environment.api.v1.environment.model.response.FreeIpaResponse in project cloudbreak by hortonworks.

the class FreeIpaConverterTest method testConvertWithFreeIpaImageIdButWithoutImageCatalog.

@Test
public void testConvertWithFreeIpaImageIdButWithoutImageCatalog() {
    // GIVEN
    FreeIpaCreationDto request = FreeIpaCreationDto.builder().withImageId(IMAGE_ID).build();
    // WHEN
    FreeIpaResponse result = underTest.convert(request);
    // THEN
    assertNull(result.getImage());
}
Also used : FreeIpaCreationDto(com.sequenceiq.environment.environment.dto.FreeIpaCreationDto) FreeIpaResponse(com.sequenceiq.environment.api.v1.environment.model.response.FreeIpaResponse) Test(org.junit.jupiter.api.Test)

Example 9 with FreeIpaResponse

use of com.sequenceiq.environment.api.v1.environment.model.response.FreeIpaResponse in project cloudbreak by hortonworks.

the class FreeIpaConverterTest method testConvertWithDefaults.

@Test
public void testConvertWithDefaults() {
    // GIVEN
    FreeIpaCreationDto request = FreeIpaCreationDto.builder().build();
    // WHEN
    FreeIpaResponse result = underTest.convert(request);
    // THEN
    assertNotNull(result);
    assertNotNull(result.getInstanceCountByGroup());
    assertEquals(1, result.getInstanceCountByGroup());
    assertNull(result.getAws());
    assertNull(result.getImage());
}
Also used : FreeIpaCreationDto(com.sequenceiq.environment.environment.dto.FreeIpaCreationDto) FreeIpaResponse(com.sequenceiq.environment.api.v1.environment.model.response.FreeIpaResponse) Test(org.junit.jupiter.api.Test)

Aggregations

FreeIpaResponse (com.sequenceiq.environment.api.v1.environment.model.response.FreeIpaResponse)9 FreeIpaCreationDto (com.sequenceiq.environment.environment.dto.FreeIpaCreationDto)6 Test (org.junit.jupiter.api.Test)6 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)2 CompactRegionResponse (com.sequenceiq.environment.api.v1.environment.model.response.CompactRegionResponse)2 EnvironmentNetworkResponse (com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse)2 EnvironmentDto (com.sequenceiq.environment.environment.dto.EnvironmentDto)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 EnumSource (org.junit.jupiter.params.provider.EnumSource)2 BackupResponse (com.sequenceiq.common.api.backup.response.BackupResponse)1 CredentialResponse (com.sequenceiq.environment.api.v1.credential.model.response.CredentialResponse)1 CredentialViewResponse (com.sequenceiq.environment.api.v1.credential.model.response.CredentialViewResponse)1 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)1 SimpleEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.SimpleEnvironmentResponse)1 ProxyResponse (com.sequenceiq.environment.api.v1.proxy.model.response.ProxyResponse)1 ProxyViewResponse (com.sequenceiq.environment.api.v1.proxy.model.response.ProxyViewResponse)1