@Test public void testFilterShouldReturnTheProperImageWhenTheCurrentImageIsAlsoAvailable() { Image imageWithSameId = createImageWithCurrentImageId(); List<Image> availableImages = List.of(properImage, imageWithSameId); ImageFilterResult imageFilterResult = new ImageFilterResult(new Images(null, availableImages, null), ""); when(versionBasedImageFilter.getCdhImagesForCbVersion(supportedCbVersions, availableImages)).thenReturn(imageFilterResult); ImageFilterResult actual = underTest.filter(availableImages, supportedCbVersions, currentImage, CLOUD_PLATFORM, lockComponents, activatedParcels); assertTrue(actual.getAvailableImages().getCdhImages().contains(properImage)); assertEquals(1, actual.getAvailableImages().getCdhImages().size()); }
public ImageFilterResult filter(List<Image> images, Versions versions, Image currentImage, String cloudPlatform, boolean lockComponents, Map<String, String> activatedParcels) { ImageFilterResult imagesForCbVersion = getImagesForCbVersion(versions, images); List<Image> imageList = imagesForCbVersion.getAvailableImages().getCdhImages(); if (CollectionUtils.isEmpty(imageList)) { return imagesForCbVersion; } LOGGER.debug("{} image(s) found for the given CB version", imageList.size()); return filterImages(imageList, currentImage, cloudPlatform, lockComponents, activatedParcels); }
ClusterUpgradeImageFilter { public ImageFilterResult filter(List<Image> images, Versions versions, Image currentImage, String cloudPlatform, boolean lockComponents, Map<String, String> activatedParcels) { ImageFilterResult imagesForCbVersion = getImagesForCbVersion(versions, images); List<Image> imageList = imagesForCbVersion.getAvailableImages().getCdhImages(); if (CollectionUtils.isEmpty(imageList)) { return imagesForCbVersion; } LOGGER.debug("{} image(s) found for the given CB version", imageList.size()); return filterImages(imageList, currentImage, cloudPlatform, lockComponents, activatedParcels); } }
ClusterUpgradeImageFilter { public ImageFilterResult filter(List<Image> images, Versions versions, Image currentImage, String cloudPlatform, boolean lockComponents, Map<String, String> activatedParcels) { ImageFilterResult imagesForCbVersion = getImagesForCbVersion(versions, images); List<Image> imageList = imagesForCbVersion.getAvailableImages().getCdhImages(); if (CollectionUtils.isEmpty(imageList)) { return imagesForCbVersion; } LOGGER.debug("{} image(s) found for the given CB version", imageList.size()); return filterImages(imageList, currentImage, cloudPlatform, lockComponents, activatedParcels); }  }
ClusterUpgradeImageFilter { public ImageFilterResult filter(List<Image> images, Versions versions, Image currentImage, String cloudPlatform, boolean lockComponents, Map<String, String> activatedParcels) { ImageFilterResult imagesForCbVersion = getImagesForCbVersion(versions, images); List<Image> imageList = imagesForCbVersion.getAvailableImages().getCdhImages(); if (CollectionUtils.isEmpty(imageList)) { return imagesForCbVersion; } LOGGER.debug("{} image(s) found for the given CB version", imageList.size()); return filterImages(imageList, currentImage, cloudPlatform, lockComponents, activatedParcels); }  ImageFilterResult filter(List<Image> images, Versions versions, Image currentImage, String cloudPlatform, boolean lockComponents,
            Map<String, String> activatedParcels); }
ClusterUpgradeImageFilter { public ImageFilterResult filter(List<Image> images, Versions versions, Image currentImage, String cloudPlatform, boolean lockComponents, Map<String, String> activatedParcels) { ImageFilterResult imagesForCbVersion = getImagesForCbVersion(versions, images); List<Image> imageList = imagesForCbVersion.getAvailableImages().getCdhImages(); if (CollectionUtils.isEmpty(imageList)) { return imagesForCbVersion; } LOGGER.debug("{} image(s) found for the given CB version", imageList.size()); return filterImages(imageList, currentImage, cloudPlatform, lockComponents, activatedParcels); }  ImageFilterResult filter(List<Image> images, Versions versions, Image currentImage, String cloudPlatform, boolean lockComponents,
            Map<String, String> activatedParcels); static final String CM_PACKAGE_KEY; }