use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.image.ImageSettingsRequest in project cloudbreak by hortonworks.
the class FreeIpaImageProviderTest method testGetImageGivenAllInputNonExistentOS.
@Test
public void testGetImageGivenAllInputNonExistentOS() {
ImageSettingsRequest is = setupImageSettingsRequest(EXISTING_ID, CUSTOM_IMAGE_CATALOG_URL, NON_EXISTING_OS);
Image image = underTest.getImage(is, DEFAULT_REGION, DEFAULT_PLATFORM).get().getImage();
assertEquals(DEFAULT_OS, image.getOs());
assertEquals(LATEST_DATE, image.getDate());
assertEquals(IMAGE_UUID, image.getUuid());
}
use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.image.ImageSettingsRequest in project cloudbreak by hortonworks.
the class FreeIpaImageProviderTest method testGetImageGivenIdInputFound.
@Test
public void testGetImageGivenIdInputFound() {
ImageSettingsRequest is = setupImageSettingsRequest(EXISTING_ID, null, null);
Image image = underTest.getImage(is, DEFAULT_REGION, DEFAULT_PLATFORM).get().getImage();
assertEquals(DEFAULT_OS, image.getOs());
assertEquals(LATEST_DATE, image.getDate());
assertEquals(IMAGE_UUID, image.getUuid());
}
use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.image.ImageSettingsRequest in project cloudbreak by hortonworks.
the class FreeIpaImageProviderTest method testGetImagesGivenNoInputWithInvalidAppVersion.
@Test
public void testGetImagesGivenNoInputWithInvalidAppVersion() {
ReflectionTestUtils.setField(underTest, FreeIpaImageProvider.class, "freeIpaVersion", "2.21.0-dcv.1", null);
ImageSettingsRequest is = setupImageSettingsRequest(null, null, "centos7");
List<ImageWrapper> images = underTest.getImages(is, DEFAULT_REGION, DEFAULT_PLATFORM);
assertTrue(images.isEmpty());
}
use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.image.ImageSettingsRequest in project cloudbreak by hortonworks.
the class FreeIpaImageProviderTest method testGetImagesGivenAllInputNonExistentOS.
@Test
public void testGetImagesGivenAllInputNonExistentOS() {
ImageSettingsRequest is = setupImageSettingsRequest(EXISTING_ID, CUSTOM_IMAGE_CATALOG_URL, NON_EXISTING_OS);
List<ImageWrapper> images = underTest.getImages(is, DEFAULT_REGION, DEFAULT_PLATFORM);
assertEquals(1, images.size());
ImageWrapper imageWrapper = images.get(0);
assertEquals(CUSTOM_IMAGE_CATALOG_URL, imageWrapper.getCatalogUrl());
assertNull(imageWrapper.getCatalogName());
Image image = imageWrapper.getImage();
assertEquals(DEFAULT_OS, image.getOs());
assertEquals(LATEST_DATE, image.getDate());
assertEquals(IMAGE_UUID, image.getUuid());
}
use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.image.ImageSettingsRequest in project cloudbreak by hortonworks.
the class FreeIpaImageProviderTest method testGetImageGivenIdInputNotFound.
@Test
public void testGetImageGivenIdInputNotFound() {
ImageSettingsRequest is = setupImageSettingsRequest(NON_EXISTING_ID, null, null);
Optional<ImageWrapper> result = underTest.getImage(is, DEFAULT_REGION, DEFAULT_PLATFORM);
assertFalse(result.isPresent());
}
Aggregations