use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.Images in project cloudbreak by hortonworks.
the class ImageCatalogProviderTest method testReadImageCatalogFromFileWithoutVersionsButWithAdvertisedFlag.
@Test
public void testReadImageCatalogFromFileWithoutVersionsButWithAdvertisedFlag() {
String path = getPath(IMAGE_CATALOG_WITHOUT_VERSIONS);
ReflectionTestUtils.setField(underTest, "etcConfigDir", path);
ReflectionTestUtils.setField(underTest, "enabledLinuxTypes", CB_CENTOS_7_FILTER);
ImageCatalog catalog = underTest.getImageCatalog(IMAGE_CATALOG_WITHOUT_VERSIONS);
List<com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.Image> images = catalog.getImages().getFreeipaImages();
assertEquals(2, images.size());
FreeIpaVersions freeIpaVersions = catalog.getVersions().getFreeIpaVersions().get(0);
assertEquals(1, freeIpaVersions.getImageIds().size());
assertEquals("91851893-8340-411d-afb7-e1b55107fb10", freeIpaVersions.getImageIds().get(0));
}
use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.Images in project cloudbreak by hortonworks.
the class ImageCatalogProviderTest method testReadImageCatalogFromFile.
@Test
public void testReadImageCatalogFromFile() {
String path = getPath(IMAGE_CATALOG_JSON);
ReflectionTestUtils.setField(underTest, "etcConfigDir", path);
ReflectionTestUtils.setField(underTest, "enabledLinuxTypes", Collections.emptyList());
ImageCatalog catalog = underTest.getImageCatalog(IMAGE_CATALOG_JSON);
List<com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.Image> images = catalog.getImages().getFreeipaImages();
assertEquals(4, images.size());
assertEquals("61851893-8340-411d-afb7-e1b55107fb10", images.get(0).getUuid());
FreeIpaVersions freeIpaVersions = catalog.getVersions().getFreeIpaVersions().get(0);
assertEquals(2, freeIpaVersions.getImageIds().size());
assertEquals("61851893-8340-411d-afb7-e1b55107fb10", freeIpaVersions.getImageIds().get(0));
assertEquals(1, freeIpaVersions.getDefaults().size());
assertEquals(List.of("71851893-8340-411d-afb7-e1b55107fb10"), freeIpaVersions.getDefaults());
assertEquals(4, freeIpaVersions.getVersions().size());
}
use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.Images in project cloudbreak by hortonworks.
the class ImageService method generateImageCatalogForStack.
public ImageCatalog generateImageCatalogForStack(Stack stack) {
final Image image = getImageForStack(stack);
final Images images = new Images(List.of(copyImageWithAdvertisedFlag(image)));
return new ImageCatalog(images, null);
}
use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.Images in project cloudbreak by hortonworks.
the class UpgradeService method getTargetImages.
private List<ImageInfoResponse> getTargetImages(String catalog, Stack stack, ImageInfoResponse currentImage) {
ImageSettingsRequest imageSettingsRequest = new ImageSettingsRequest();
imageSettingsRequest.setCatalog(catalog);
LOGGER.debug("Using ImageSettingsRequest to query for possible target images: {}", imageSettingsRequest);
List<ImageInfoResponse> targetImages = imageService.findTargetImages(stack, imageSettingsRequest, currentImage);
LOGGER.debug("Found target images: {}", targetImages);
return targetImages;
}
use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.image.Images in project cloudbreak by hortonworks.
the class FreeIpaImageProviderTest method testGetImagesNoInput.
@Test
public void testGetImagesNoInput() {
ImageSettingsRequest imageSettingsRequest = setupImageSettingsRequest(null, null, null);
List<ImageWrapper> images = underTest.getImages(imageSettingsRequest, DEFAULT_REGION, DEFAULT_PLATFORM);
assertEquals(2, images.size());
assertThat(images, everyItem(allOf(hasProperty("image", hasProperty("os", is(DEFAULT_OS))), hasProperty("catalogUrl", is(DEFAULT_CATALOG_URL)), hasProperty("catalogName", is(nullValue())))));
assertThat(images, hasItem(allOf(hasProperty("image", allOf(hasProperty("uuid", is(IMAGE_UUID)), hasProperty("date", is(LATEST_DATE)))))));
assertThat(images, hasItem(allOf(hasProperty("image", allOf(hasProperty("uuid", is("71851893-8340-411d-afb7-e1b55107fb10")), hasProperty("date", is(LATEST_DATE_NO_INPUT)))))));
}
Aggregations