use of com.sequenceiq.environment.environment.dto.FreeIpaCreationDto in project cloudbreak by hortonworks.
the class FreeIpaConverterTest method testConvertWithFreeIpaImageCatalogAndId.
@Test
public void testConvertWithFreeIpaImageCatalogAndId() {
// GIVEN
FreeIpaCreationDto request = FreeIpaCreationDto.builder().withImageId(IMAGE_ID).withImageCatalog(IMAGE_CATALOG).build();
// WHEN
FreeIpaResponse result = underTest.convert(request);
// THEN
assertEquals(IMAGE_ID, result.getImage().getId());
assertEquals(IMAGE_CATALOG, result.getImage().getCatalog());
}
use of com.sequenceiq.environment.environment.dto.FreeIpaCreationDto in project cloudbreak by hortonworks.
the class FreeIpaConverterTest method testConvertWithTwoInstancesAndOnlySpotInstances.
@Test
public void testConvertWithTwoInstancesAndOnlySpotInstances() {
// GIVEN
FreeIpaCreationDto request = FreeIpaCreationDto.builder().withInstanceCountByGroup(2).withAws(FreeIpaCreationAwsParametersDto.builder().withSpot(FreeIpaCreationAwsSpotParametersDto.builder().withPercentage(100).withMaxPrice(0.9).build()).build()).build();
// WHEN
FreeIpaResponse result = underTest.convert(request);
// THEN
assertNotNull(result);
assertNotNull(result.getInstanceCountByGroup());
assertEquals(2, result.getInstanceCountByGroup());
assertEquals(100, result.getAws().getSpot().getPercentage());
assertEquals(0.9, result.getAws().getSpot().getMaxPrice());
}
use of com.sequenceiq.environment.environment.dto.FreeIpaCreationDto 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());
}
use of com.sequenceiq.environment.environment.dto.FreeIpaCreationDto 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.environment.dto.FreeIpaCreationDto 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());
}
Aggregations