use of com.sequenceiq.cloudbreak.service.image.StatedImages in project cloudbreak by hortonworks.
the class VersionBasedImageCatalogServiceTest method testGetImagesShouldCallRawImageProviderWhenTheCbVersionIsNotPresent.
@Test
public void testGetImagesShouldCallRawImageProviderWhenTheCbVersionIsNotPresent() {
StatedImages statedImages = mock(StatedImages.class);
when(rawImageProvider.getImages(imageCatalogV3, imageFilter)).thenReturn(statedImages);
StatedImages actual = victim.getImages(imageCatalogV3, imageFilter);
assertEquals(statedImages, actual);
verify(rawImageProvider).getImages(imageCatalogV3, imageFilter);
}
use of com.sequenceiq.cloudbreak.service.image.StatedImages in project cloudbreak by hortonworks.
the class AdvertisedImageProviderTest method shouldIncludeBaseImagesWhenBaseImagesAreEnabled.
@Test
public void shouldIncludeBaseImagesWhenBaseImagesAreEnabled() {
CloudbreakImageCatalogV3 imageCatalog = anImageCatalogV3();
StatedImages actual = victim.getImages(anImageCatalogV3(), createImageFilter(true));
assertFalse(imageCatalog.getImages().getBaseImages().isEmpty());
assertFalse(actual.getImages().getBaseImages().isEmpty());
}
use of com.sequenceiq.cloudbreak.service.image.StatedImages in project cloudbreak by hortonworks.
the class AdvertisedImageProviderTest method shouldSetUpImageCatalogNameAndUrl.
@Test
public void shouldSetUpImageCatalogNameAndUrl() {
ImageFilter imageFilter = createImageFilter(false);
StatedImages actual = victim.getImages(anImageCatalogV3(), createImageFilter(false));
assertEquals(imageFilter.getImageCatalog().getImageCatalogUrl(), actual.getImageCatalogUrl());
assertEquals(imageFilter.getImageCatalog().getName(), actual.getImageCatalogName());
}
use of com.sequenceiq.cloudbreak.service.image.StatedImages in project cloudbreak by hortonworks.
the class ImageBasedDefaultCDHEntries method getEntries.
public Map<String, ImageBasedDefaultCDHInfo> getEntries(Long workspaceId, ImageCatalogPlatform platform, String imageCatalogName) throws CloudbreakImageCatalogException {
String catalogName = Optional.ofNullable(imageCatalogName).orElse(ImageCatalogService.CDP_DEFAULT_CATALOG_NAME);
StatedImages images = imageCatalogService.getImages(workspaceId, catalogName, platform);
if (images.getImages().getCdhImages().isEmpty()) {
LOGGER.warn("Missing CDH images for cloud platform: {}. Falling back to AWS.", platform);
images = imageCatalogService.getImages(workspaceId, catalogName, imageCatalogPlatform(CloudPlatform.AWS.name()));
}
return getEntries(images.getImages());
}
use of com.sequenceiq.cloudbreak.service.image.StatedImages 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());
}
Aggregations