@Test void filterNoEntities() { IdentityProviderFilter filter = new IdentityProviderFilter(); Bundle filteredBundle = new Bundle(); Bundle bundle = FilterTestUtils.getBundle(); bundle.setDependencyMap(Collections.emptyMap()); List<IdentityProvider> filteredEntities = filter.filter("/my/folder/path", new FilterConfiguration(), bundle, filteredBundle); assertEquals(0, filteredEntities.size()); }
@Override public List<IdentityProvider> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { Stream<IdentityProvider> identityProviderEntityStream = DependencyUtils.filterDependencies(IdentityProvider.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())).stream(); if (!filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(IdentityProvider.INTERNAL_IDP_NAME)) { identityProviderEntityStream = identityProviderEntityStream .filter(idp -> !IdentityProvider.INTERNAL_IDP_ID.equals(idp.getId())); } List<IdentityProvider> identityProviders = identityProviderEntityStream.collect(Collectors.toList()); DependencyUtils.validateEntitiesInList(identityProviders, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "Identity Provider(s)"); return identityProviders; }
IdentityProviderFilter implements EntityFilter<IdentityProvider> { @Override public List<IdentityProvider> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { Stream<IdentityProvider> identityProviderEntityStream = DependencyUtils.filterDependencies(IdentityProvider.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())).stream(); if (!filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(IdentityProvider.INTERNAL_IDP_NAME)) { identityProviderEntityStream = identityProviderEntityStream .filter(idp -> !IdentityProvider.INTERNAL_IDP_ID.equals(idp.getId())); } List<IdentityProvider> identityProviders = identityProviderEntityStream.collect(Collectors.toList()); DependencyUtils.validateEntitiesInList(identityProviders, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "Identity Provider(s)"); return identityProviders; } }
IdentityProviderFilter implements EntityFilter<IdentityProvider> { @Override public List<IdentityProvider> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { Stream<IdentityProvider> identityProviderEntityStream = DependencyUtils.filterDependencies(IdentityProvider.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())).stream(); if (!filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(IdentityProvider.INTERNAL_IDP_NAME)) { identityProviderEntityStream = identityProviderEntityStream .filter(idp -> !IdentityProvider.INTERNAL_IDP_ID.equals(idp.getId())); } List<IdentityProvider> identityProviders = identityProviderEntityStream.collect(Collectors.toList()); DependencyUtils.validateEntitiesInList(identityProviders, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "Identity Provider(s)"); return identityProviders; }  }
IdentityProviderFilter implements EntityFilter<IdentityProvider> { @Override public List<IdentityProvider> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { Stream<IdentityProvider> identityProviderEntityStream = DependencyUtils.filterDependencies(IdentityProvider.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())).stream(); if (!filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(IdentityProvider.INTERNAL_IDP_NAME)) { identityProviderEntityStream = identityProviderEntityStream .filter(idp -> !IdentityProvider.INTERNAL_IDP_ID.equals(idp.getId())); } List<IdentityProvider> identityProviders = identityProviderEntityStream.collect(Collectors.toList()); DependencyUtils.validateEntitiesInList(identityProviders, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "Identity Provider(s)"); return identityProviders; }  @Override @NotNull Collection<Class<? extends EntityFilter>> getDependencyEntityFilters(); @Override List<IdentityProvider> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle); @Override String getFilterableEntityName(); }
IdentityProviderFilter implements EntityFilter<IdentityProvider> { @Override public List<IdentityProvider> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { Stream<IdentityProvider> identityProviderEntityStream = DependencyUtils.filterDependencies(IdentityProvider.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())).stream(); if (!filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(IdentityProvider.INTERNAL_IDP_NAME)) { identityProviderEntityStream = identityProviderEntityStream .filter(idp -> !IdentityProvider.INTERNAL_IDP_ID.equals(idp.getId())); } List<IdentityProvider> identityProviders = identityProviderEntityStream.collect(Collectors.toList()); DependencyUtils.validateEntitiesInList(identityProviders, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "Identity Provider(s)"); return identityProviders; }  @Override @NotNull Collection<Class<? extends EntityFilter>> getDependencyEntityFilters(); @Override List<IdentityProvider> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle); @Override String getFilterableEntityName();  }