@Test public void shouldReturnImageBasedDefaultCDHInfoMapByDefaultCdhImages() { List<Image> imageList = getImages(); when(images.getCdhImages()).thenReturn(imageList); Map<String, ImageBasedDefaultCDHInfo> actual = victim.getEntries(images); Image image = imageList.stream().filter(Image::isDefaultImage).findFirst().get(); verify(image, actual.get(IMAGE_VERSION)); }
public Map<String, ImageBasedDefaultCDHInfo> getEntries(Long workspaceId, String 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, CloudPlatform.AWS.name()); } return getEntries(images.getImages()); }
ImageBasedDefaultCDHEntries { public Map<String, ImageBasedDefaultCDHInfo> getEntries(Long workspaceId, String 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, CloudPlatform.AWS.name()); } return getEntries(images.getImages()); } }
ImageBasedDefaultCDHEntries { public Map<String, ImageBasedDefaultCDHInfo> getEntries(Long workspaceId, String 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, CloudPlatform.AWS.name()); } return getEntries(images.getImages()); }  }
ImageBasedDefaultCDHEntries { public Map<String, ImageBasedDefaultCDHInfo> getEntries(Long workspaceId, String 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, CloudPlatform.AWS.name()); } return getEntries(images.getImages()); }  Map<String, ImageBasedDefaultCDHInfo> getEntries(Long workspaceId, String platform, String imageCatalogName); Map<String, ImageBasedDefaultCDHInfo> getEntries(Images images); }
ImageBasedDefaultCDHEntries { public Map<String, ImageBasedDefaultCDHInfo> getEntries(Long workspaceId, String 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, CloudPlatform.AWS.name()); } return getEntries(images.getImages()); }  Map<String, ImageBasedDefaultCDHInfo> getEntries(Long workspaceId, String platform, String imageCatalogName); Map<String, ImageBasedDefaultCDHInfo> getEntries(Images images); static final Comparator<Map.Entry<String, ImageBasedDefaultCDHInfo>> IMAGE_BASED_CDH_ENTRY_COMPARATOR; }