@Test public void testFilterShouldNotReturnImageIfCmAndStackFilterReturnFalse() { List<Image> properImages = List.of(properImage); ImageFilterResult imageFilterResult = new ImageFilterResult(new Images(null, properImages, null), ""); Predicate<Image> predicate = mock(Predicate.class); when(predicate.test(any())).thenReturn(Boolean.FALSE); when(cmAndStackVersionFilter.filterCmAndStackVersion(any(Image.class), anyBoolean(), anyMap(), any())).thenReturn(predicate); when(versionBasedImageFilter.getCdhImagesForCbVersion(supportedCbVersions, properImages)).thenReturn(imageFilterResult); ImageFilterResult actual = underTest.filter(properImages, supportedCbVersions, currentImage, CLOUD_PLATFORM, lockComponents, activatedParcels); assertTrue(actual.getAvailableImages().getCdhImages().isEmpty()); }
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; }