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;
}
}
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);
}
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());
}
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());
}
Aggregations