@Test void filterNoEntities() { ClusterPropertyFilter filter = new ClusterPropertyFilter(); Bundle filteredBundle = new Bundle(); Bundle bundle = FilterTestUtils.getBundle(); bundle.setDependencyMap(Collections.emptyMap()); List<ClusterProperty> clusterProperties = filter.filter("/my/folder/path", new FilterConfiguration(), bundle, filteredBundle); assertEquals(0, clusterProperties.size()); }
@Override public List<ClusterProperty> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { Stream<ClusterProperty> clusterPropertiesStream = DependencyUtils.filterDependencies(ClusterProperty.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())).stream(); clusterPropertiesStream = clusterPropertiesStream.filter(e -> !ClusterProperty.CLUSTER_HOSTNAME_PROPERTY_NAME.equals(e.getName())); List<ClusterProperty> clusterProperties = clusterPropertiesStream.collect(Collectors.toList()); DependencyUtils.validateEntitiesInList(clusterProperties, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "Cluster Propert(ies)"); return clusterProperties; }
ClusterPropertyFilter implements EntityFilter<ClusterProperty> { @Override public List<ClusterProperty> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { Stream<ClusterProperty> clusterPropertiesStream = DependencyUtils.filterDependencies(ClusterProperty.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())).stream(); clusterPropertiesStream = clusterPropertiesStream.filter(e -> !ClusterProperty.CLUSTER_HOSTNAME_PROPERTY_NAME.equals(e.getName())); List<ClusterProperty> clusterProperties = clusterPropertiesStream.collect(Collectors.toList()); DependencyUtils.validateEntitiesInList(clusterProperties, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "Cluster Propert(ies)"); return clusterProperties; } }
ClusterPropertyFilter implements EntityFilter<ClusterProperty> { @Override public List<ClusterProperty> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { Stream<ClusterProperty> clusterPropertiesStream = DependencyUtils.filterDependencies(ClusterProperty.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())).stream(); clusterPropertiesStream = clusterPropertiesStream.filter(e -> !ClusterProperty.CLUSTER_HOSTNAME_PROPERTY_NAME.equals(e.getName())); List<ClusterProperty> clusterProperties = clusterPropertiesStream.collect(Collectors.toList()); DependencyUtils.validateEntitiesInList(clusterProperties, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "Cluster Propert(ies)"); return clusterProperties; }  }
ClusterPropertyFilter implements EntityFilter<ClusterProperty> { @Override public List<ClusterProperty> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { Stream<ClusterProperty> clusterPropertiesStream = DependencyUtils.filterDependencies(ClusterProperty.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())).stream(); clusterPropertiesStream = clusterPropertiesStream.filter(e -> !ClusterProperty.CLUSTER_HOSTNAME_PROPERTY_NAME.equals(e.getName())); List<ClusterProperty> clusterProperties = clusterPropertiesStream.collect(Collectors.toList()); DependencyUtils.validateEntitiesInList(clusterProperties, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "Cluster Propert(ies)"); return clusterProperties; }  @Override @NotNull Collection<Class<? extends EntityFilter>> getDependencyEntityFilters(); @Override List<ClusterProperty> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle); @Override String getFilterableEntityName(); }
ClusterPropertyFilter implements EntityFilter<ClusterProperty> { @Override public List<ClusterProperty> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { Stream<ClusterProperty> clusterPropertiesStream = DependencyUtils.filterDependencies(ClusterProperty.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())).stream(); clusterPropertiesStream = clusterPropertiesStream.filter(e -> !ClusterProperty.CLUSTER_HOSTNAME_PROPERTY_NAME.equals(e.getName())); List<ClusterProperty> clusterProperties = clusterPropertiesStream.collect(Collectors.toList()); DependencyUtils.validateEntitiesInList(clusterProperties, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "Cluster Propert(ies)"); return clusterProperties; }  @Override @NotNull Collection<Class<? extends EntityFilter>> getDependencyEntityFilters(); @Override List<ClusterProperty> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle); @Override String getFilterableEntityName();  }