Search in sources :

Example 46 with CloudbreakImageCatalogV3

use of com.sequenceiq.cloudbreak.cloud.model.catalog.CloudbreakImageCatalogV3 in project cloudbreak by hortonworks.

the class CloudbreakVersionListProviderTest method testGetVersionsWithNullCatalogVersions.

@Test
public void testGetVersionsWithNullCatalogVersions() {
    CloudbreakImageCatalogV3 catalog = new CloudbreakImageCatalogV3(null, null);
    List<CloudbreakVersion> versions = underTest.getVersions(catalog);
    assertNotNull(versions);
    assertTrue(versions.isEmpty());
}
Also used : CloudbreakVersion(com.sequenceiq.cloudbreak.cloud.model.catalog.CloudbreakVersion) CloudbreakImageCatalogV3(com.sequenceiq.cloudbreak.cloud.model.catalog.CloudbreakImageCatalogV3) Test(org.junit.Test)

Example 47 with CloudbreakImageCatalogV3

use of com.sequenceiq.cloudbreak.cloud.model.catalog.CloudbreakImageCatalogV3 in project cloudbreak by hortonworks.

the class AdvertisedImageProviderTest method shouldNotIncludeBaseImagesWhenBaseImagesAreDisabled.

@Test
public void shouldNotIncludeBaseImagesWhenBaseImagesAreDisabled() {
    CloudbreakImageCatalogV3 imageCatalog = anImageCatalogV3();
    StatedImages actual = victim.getImages(anImageCatalogV3(), createImageFilter(false));
    assertFalse(imageCatalog.getImages().getBaseImages().isEmpty());
    assertTrue(actual.getImages().getBaseImages().isEmpty());
}
Also used : CloudbreakImageCatalogV3(com.sequenceiq.cloudbreak.cloud.model.catalog.CloudbreakImageCatalogV3) StatedImages(com.sequenceiq.cloudbreak.service.image.StatedImages) Test(org.junit.jupiter.api.Test)

Example 48 with CloudbreakImageCatalogV3

use of com.sequenceiq.cloudbreak.cloud.model.catalog.CloudbreakImageCatalogV3 in project cloudbreak by hortonworks.

the class RawImageProviderTest method testGetImagesShouldReturnOnlyTheAwsImagesFromTheImageCatalog.

@Test
void testGetImagesShouldReturnOnlyTheAwsImagesFromTheImageCatalog() {
    ImageFilter imageFilter = createImageFilter();
    CloudbreakImageCatalogV3 imageCatalogV3 = createImageCatalog();
    StatedImages actual = underTest.getImages(imageCatalogV3, imageFilter);
    assertEquals(IMAGE_CATALOG_NAME, actual.getImageCatalogName());
    assertEquals(IMAGE_CATALOG_URL, actual.getImageCatalogUrl());
    Images images = actual.getImages();
    assertTrue(images.getBaseImages().stream().anyMatch(image -> BASE_IMAGE_AWS.equals(image.getUuid())));
    assertTrue(images.getBaseImages().stream().noneMatch(image -> BASE_IMAGE_AZURE.equals(image.getUuid())));
    assertTrue(images.getCdhImages().stream().anyMatch(image -> CDH_IMAGE_AWS.equals(image.getUuid())));
    assertTrue(images.getCdhImages().stream().noneMatch(image -> CDH_IMAGE_AZURE.equals(image.getUuid())));
    assertTrue(images.getFreeIpaImages().stream().anyMatch(image -> FREEIPA_IMAGE_AWS.equals(image.getUuid())));
    assertTrue(images.getFreeIpaImages().stream().noneMatch(image -> FREEIPA_IMAGE_AZURE.equals(image.getUuid())));
}
Also used : Image(com.sequenceiq.cloudbreak.cloud.model.catalog.Image) ImageCatalog(com.sequenceiq.cloudbreak.domain.ImageCatalog) ImageFilter(com.sequenceiq.cloudbreak.service.image.ImageFilter) ImageCatalogPlatform.imageCatalogPlatform(com.sequenceiq.cloudbreak.service.image.catalog.model.ImageCatalogPlatform.imageCatalogPlatform) Test(org.junit.jupiter.api.Test) AWS(com.sequenceiq.cloudbreak.common.mappable.CloudPlatform.AWS) List(java.util.List) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) Map(java.util.Map) Images(com.sequenceiq.cloudbreak.cloud.model.catalog.Images) AZURE(com.sequenceiq.cloudbreak.common.mappable.CloudPlatform.AZURE) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) CloudbreakImageCatalogV3(com.sequenceiq.cloudbreak.cloud.model.catalog.CloudbreakImageCatalogV3) StatedImages(com.sequenceiq.cloudbreak.service.image.StatedImages) Collections(java.util.Collections) ImageFilter(com.sequenceiq.cloudbreak.service.image.ImageFilter) Images(com.sequenceiq.cloudbreak.cloud.model.catalog.Images) StatedImages(com.sequenceiq.cloudbreak.service.image.StatedImages) CloudbreakImageCatalogV3(com.sequenceiq.cloudbreak.cloud.model.catalog.CloudbreakImageCatalogV3) StatedImages(com.sequenceiq.cloudbreak.service.image.StatedImages) Test(org.junit.jupiter.api.Test)

Aggregations

CloudbreakImageCatalogV3 (com.sequenceiq.cloudbreak.cloud.model.catalog.CloudbreakImageCatalogV3)48 Test (org.junit.jupiter.api.Test)21 Image (com.sequenceiq.cloudbreak.cloud.model.catalog.Image)17 Test (org.junit.Test)14 ImageFilterResult (com.sequenceiq.cloudbreak.service.upgrade.image.ImageFilterResult)10 UpgradeV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.upgrade.UpgradeV4Response)8 ImageFilterParams (com.sequenceiq.cloudbreak.service.upgrade.image.ImageFilterParams)8 ImageCatalog (com.sequenceiq.cloudbreak.domain.ImageCatalog)7 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)7 Images (com.sequenceiq.cloudbreak.cloud.model.catalog.Images)6 CloudbreakVersion (com.sequenceiq.cloudbreak.cloud.model.catalog.CloudbreakVersion)5 CloudbreakImageCatalogException (com.sequenceiq.cloudbreak.core.CloudbreakImageCatalogException)5 StatedImages (com.sequenceiq.cloudbreak.service.image.StatedImages)5 Image (com.sequenceiq.cloudbreak.cloud.model.Image)4 CloudbreakImageNotFoundException (com.sequenceiq.cloudbreak.core.CloudbreakImageNotFoundException)4 List (java.util.List)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 Versions (com.sequenceiq.cloudbreak.cloud.model.catalog.Versions)3 ImageFilter (com.sequenceiq.cloudbreak.service.image.ImageFilter)3 ImageCatalogWrapper (com.sequenceiq.cloudbreak.service.image.catalog.model.ImageCatalogWrapper)3