SsgActiveConnectorFilter implements EntityFilter<SsgActiveConnector> { @Override public List<SsgActiveConnector> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { List<SsgActiveConnector> ssgActiveConnectors = DependencyUtils.filterDependencies(SsgActiveConnector.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())); DependencyUtils.validateEntitiesInList(ssgActiveConnectors, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "Ssg Active Connector(s)"); return ssgActiveConnectors; }  @Override @NotNull Collection<Class<? extends EntityFilter>> getDependencyEntityFilters(); @Override List<SsgActiveConnector> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle); @Override String getFilterableEntityName();  }
@Test public void testFilter() { SsgActiveConnectorFilter ssgActiveConnectorFilter = new SsgActiveConnectorFilter(); FilterConfiguration filterConfiguration = new FilterConfiguration(); Map<String, Collection<String>> entityFilters = new HashMap<>(); Collection entityNames = new LinkedList(); entityNames.add("testName"); entityFilters.put("activeConnectors", entityNames); filterConfiguration.setEntityFilters(entityFilters); List<SsgActiveConnector> filteredEntities = ssgActiveConnectorFilter.filter("/", filterConfiguration, getTestBundle(), new Bundle()); Assert.assertEquals(1, filteredEntities.size()); entityFilters.put("activeConnectors", Collections.EMPTY_LIST); filterConfiguration.setEntityFilters(entityFilters); filteredEntities = ssgActiveConnectorFilter.filter("/", filterConfiguration, getTestBundle(), new Bundle()); Assert.assertEquals(0, filteredEntities.size()); }