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