@Test public void testReadImageCatalogFromFile() throws Exception { String path = getPath(CB_IMAGE_CATALOG_V2_JSON); ReflectionTestUtils.setField(underTest, "etcConfigDir", path); ReflectionTestUtils.setField(underTest, "enabledLinuxTypes", Collections.emptyList()); CloudbreakImageCatalogV3 catalog = underTest.getImageCatalogV3(CB_IMAGE_CATALOG_V2_JSON); assertNotNull("Check that the parsed ImageCatalog not null.", catalog); Optional<CloudbreakVersion> ver = catalog.getVersions().getCloudbreakVersions().stream().filter(v -> v.getVersions().contains(CB_VERSION)).findFirst(); Assert.assertTrue("Check that the parsed ImageCatalog contains the desired version of Cloudbreak.", ver.isPresent()); List<String> imageIds = ver.get().getImageIds(); assertNotNull("Check that the parsed ImageCatalog contains the desired version of Cloudbreak with image id(s).", imageIds); Optional<String> imageIdOptional = imageIds.stream().findFirst(); Assert.assertTrue("Check that the parsed ImageCatalog contains image reference for the Cloudbreak version.", imageIdOptional.isPresent()); String imageId = imageIdOptional.get(); boolean baseImageFound = false; if (catalog.getImages().getBaseImages() != null) { baseImageFound = catalog.getImages().getBaseImages().stream().anyMatch(i -> i.getUuid().equals(imageId)); } Assert.assertTrue("Check that the parsed ImageCatalog contains image for the Cloudbreak version.", baseImageFound); }
public CloudbreakImageCatalogV3 getImageCatalogV3(String catalogUrl) throws CloudbreakImageCatalogException { return getImageCatalogV3(catalogUrl, false); }
ImageCatalogProvider { public CloudbreakImageCatalogV3 getImageCatalogV3(String catalogUrl) throws CloudbreakImageCatalogException { return getImageCatalogV3(catalogUrl, false); } }
ImageCatalogProvider { public CloudbreakImageCatalogV3 getImageCatalogV3(String catalogUrl) throws CloudbreakImageCatalogException { return getImageCatalogV3(catalogUrl, false); }  }
ImageCatalogProvider { public CloudbreakImageCatalogV3 getImageCatalogV3(String catalogUrl) throws CloudbreakImageCatalogException { return getImageCatalogV3(catalogUrl, false); }  CloudbreakImageCatalogV3 getImageCatalogV3(String catalogUrl); CloudbreakImageCatalogV3 getImageCatalogV3(String catalogUrl, boolean forceRefresh); }
ImageCatalogProvider { public CloudbreakImageCatalogV3 getImageCatalogV3(String catalogUrl) throws CloudbreakImageCatalogException { return getImageCatalogV3(catalogUrl, false); }  CloudbreakImageCatalogV3 getImageCatalogV3(String catalogUrl); CloudbreakImageCatalogV3 getImageCatalogV3(String catalogUrl, boolean forceRefresh);  }