@Test public void filterUnreleasedVersions() { List<String> list1 = generateVersionList(devVersion, unReleasedVersion); List<String> list2 = generateVersionList(releasedVersion, extendedUnreleasedVersion); versions = generateCloudBreakVersions(list1, list2); assertEquals(2, versions.size()); assertEquals(1, underTest.filterUnreleasedVersions(versions, unReleasedVersion).size()); }
public Set<CloudbreakVersion> filterUnreleasedVersions(Collection<CloudbreakVersion> cloudbreakVersions, String unReleasedVersion) { Map<Boolean, List<CloudbreakVersion>> partitionedVersions = cloudbreakVersions.stream() .collect(Collectors.partitioningBy(containsNonReleaseVersion(unReleasedVersion))); if (hasFiltered(partitionedVersions)) { LOGGER.debug("Used filter unReleasedVersion: | {} | Versions filtered: {}", unReleasedVersion, partitionedVersions.get(false).stream() .map(CloudbreakVersion::getVersions).flatMap(List::stream) .collect(Collectors.joining(", "))); } return new HashSet<>(partitionedVersions.get(true)); }
ImageCatalogVersionFilter { public Set<CloudbreakVersion> filterUnreleasedVersions(Collection<CloudbreakVersion> cloudbreakVersions, String unReleasedVersion) { Map<Boolean, List<CloudbreakVersion>> partitionedVersions = cloudbreakVersions.stream() .collect(Collectors.partitioningBy(containsNonReleaseVersion(unReleasedVersion))); if (hasFiltered(partitionedVersions)) { LOGGER.debug("Used filter unReleasedVersion: | {} | Versions filtered: {}", unReleasedVersion, partitionedVersions.get(false).stream() .map(CloudbreakVersion::getVersions).flatMap(List::stream) .collect(Collectors.joining(", "))); } return new HashSet<>(partitionedVersions.get(true)); } }
ImageCatalogVersionFilter { public Set<CloudbreakVersion> filterUnreleasedVersions(Collection<CloudbreakVersion> cloudbreakVersions, String unReleasedVersion) { Map<Boolean, List<CloudbreakVersion>> partitionedVersions = cloudbreakVersions.stream() .collect(Collectors.partitioningBy(containsNonReleaseVersion(unReleasedVersion))); if (hasFiltered(partitionedVersions)) { LOGGER.debug("Used filter unReleasedVersion: | {} | Versions filtered: {}", unReleasedVersion, partitionedVersions.get(false).stream() .map(CloudbreakVersion::getVersions).flatMap(List::stream) .collect(Collectors.joining(", "))); } return new HashSet<>(partitionedVersions.get(true)); }  }
ImageCatalogVersionFilter { public Set<CloudbreakVersion> filterUnreleasedVersions(Collection<CloudbreakVersion> cloudbreakVersions, String unReleasedVersion) { Map<Boolean, List<CloudbreakVersion>> partitionedVersions = cloudbreakVersions.stream() .collect(Collectors.partitioningBy(containsNonReleaseVersion(unReleasedVersion))); if (hasFiltered(partitionedVersions)) { LOGGER.debug("Used filter unReleasedVersion: | {} | Versions filtered: {}", unReleasedVersion, partitionedVersions.get(false).stream() .map(CloudbreakVersion::getVersions).flatMap(List::stream) .collect(Collectors.joining(", "))); } return new HashSet<>(partitionedVersions.get(true)); }  Set<CloudbreakVersion> filterReleasedVersions(Collection<CloudbreakVersion> cloudbreakVersions, String releasedVersion); Set<CloudbreakVersion> filterUnreleasedVersions(Collection<CloudbreakVersion> cloudbreakVersions, String unReleasedVersion); String latestCloudbreakVersion(Iterable<CloudbreakVersion> cloudbreakVersions); boolean isVersionUnspecified(String cbVersion); String extractUnreleasedVersion(String cbVersion); String extractReleasedVersion(String cbVersion); String extractExtendedUnreleasedVersion(String cbVersion); }
ImageCatalogVersionFilter { public Set<CloudbreakVersion> filterUnreleasedVersions(Collection<CloudbreakVersion> cloudbreakVersions, String unReleasedVersion) { Map<Boolean, List<CloudbreakVersion>> partitionedVersions = cloudbreakVersions.stream() .collect(Collectors.partitioningBy(containsNonReleaseVersion(unReleasedVersion))); if (hasFiltered(partitionedVersions)) { LOGGER.debug("Used filter unReleasedVersion: | {} | Versions filtered: {}", unReleasedVersion, partitionedVersions.get(false).stream() .map(CloudbreakVersion::getVersions).flatMap(List::stream) .collect(Collectors.joining(", "))); } return new HashSet<>(partitionedVersions.get(true)); }  Set<CloudbreakVersion> filterReleasedVersions(Collection<CloudbreakVersion> cloudbreakVersions, String releasedVersion); Set<CloudbreakVersion> filterUnreleasedVersions(Collection<CloudbreakVersion> cloudbreakVersions, String unReleasedVersion); String latestCloudbreakVersion(Iterable<CloudbreakVersion> cloudbreakVersions); boolean isVersionUnspecified(String cbVersion); String extractUnreleasedVersion(String cbVersion); String extractReleasedVersion(String cbVersion); String extractExtendedUnreleasedVersion(String cbVersion);  }