@Test void filterNoEntities() { JDBCConnectionFilter filter = new JDBCConnectionFilter(); Bundle filteredBundle = new Bundle(); Bundle bundle = FilterTestUtils.getBundle(); bundle.setDependencyMap(Collections.emptyMap()); List<JdbcConnection> filteredEntities = filter.filter("/my/folder/path", new FilterConfiguration(), bundle, filteredBundle); assertEquals(0, filteredEntities.size()); }
@Override public List<JdbcConnection> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { List<JdbcConnection> jdbcConnections = DependencyUtils.filterDependencies(JdbcConnection.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())); DependencyUtils.validateEntitiesInList(jdbcConnections, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "JDBC Connection(s)"); return jdbcConnections; }
JDBCConnectionFilter implements EntityFilter<JdbcConnection> { @Override public List<JdbcConnection> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { List<JdbcConnection> jdbcConnections = DependencyUtils.filterDependencies(JdbcConnection.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())); DependencyUtils.validateEntitiesInList(jdbcConnections, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "JDBC Connection(s)"); return jdbcConnections; } }
JDBCConnectionFilter implements EntityFilter<JdbcConnection> { @Override public List<JdbcConnection> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { List<JdbcConnection> jdbcConnections = DependencyUtils.filterDependencies(JdbcConnection.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())); DependencyUtils.validateEntitiesInList(jdbcConnections, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "JDBC Connection(s)"); return jdbcConnections; }  }
JDBCConnectionFilter implements EntityFilter<JdbcConnection> { @Override public List<JdbcConnection> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { List<JdbcConnection> jdbcConnections = DependencyUtils.filterDependencies(JdbcConnection.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())); DependencyUtils.validateEntitiesInList(jdbcConnections, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "JDBC Connection(s)"); return jdbcConnections; }  @Override @NotNull Collection<Class<? extends EntityFilter>> getDependencyEntityFilters(); @Override List<JdbcConnection> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle); @Override String getFilterableEntityName(); }
JDBCConnectionFilter implements EntityFilter<JdbcConnection> { @Override public List<JdbcConnection> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { List<JdbcConnection> jdbcConnections = DependencyUtils.filterDependencies(JdbcConnection.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())); DependencyUtils.validateEntitiesInList(jdbcConnections, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "JDBC Connection(s)"); return jdbcConnections; }  @Override @NotNull Collection<Class<? extends EntityFilter>> getDependencyEntityFilters(); @Override List<JdbcConnection> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle); @Override String getFilterableEntityName();  }