@Test void filterNoEntities() { EncassFilter filter = new EncassFilter(); Bundle filteredBundle = new Bundle(); Bundle bundle = FilterTestUtils.getBundle(); bundle.setDependencyMap(Collections.emptyMap()); List<Encass> filteredEntities = filter.filter("/my/folder/path", new FilterConfiguration(), bundle, filteredBundle); assertEquals(0, filteredEntities.size()); }
@Override public List<Encass> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { Map<String, Policy> policies = filteredBundle.getPolicies(); return bundle.getEntities(Encass.class).values().stream() .filter(e -> policies.containsKey(e.getPolicyId())).collect(Collectors.toList()); }
EncassFilter implements EntityFilter<Encass> { @Override public List<Encass> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { Map<String, Policy> policies = filteredBundle.getPolicies(); return bundle.getEntities(Encass.class).values().stream() .filter(e -> policies.containsKey(e.getPolicyId())).collect(Collectors.toList()); } }
EncassFilter implements EntityFilter<Encass> { @Override public List<Encass> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { Map<String, Policy> policies = filteredBundle.getPolicies(); return bundle.getEntities(Encass.class).values().stream() .filter(e -> policies.containsKey(e.getPolicyId())).collect(Collectors.toList()); }  }
EncassFilter implements EntityFilter<Encass> { @Override public List<Encass> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { Map<String, Policy> policies = filteredBundle.getPolicies(); return bundle.getEntities(Encass.class).values().stream() .filter(e -> policies.containsKey(e.getPolicyId())).collect(Collectors.toList()); }  @Override @NotNull Collection<Class<? extends EntityFilter>> getDependencyEntityFilters(); @Override List<Encass> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle); }
EncassFilter implements EntityFilter<Encass> { @Override public List<Encass> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { Map<String, Policy> policies = filteredBundle.getPolicies(); return bundle.getEntities(Encass.class).values().stream() .filter(e -> policies.containsKey(e.getPolicyId())).collect(Collectors.toList()); }  @Override @NotNull Collection<Class<? extends EntityFilter>> getDependencyEntityFilters(); @Override List<Encass> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle);  }