@Test void filterNoEntities() { StoredPasswordFilter filter = new StoredPasswordFilter(); Bundle filteredBundle = new Bundle(); Bundle bundle = FilterTestUtils.getBundle(); bundle.setDependencyMap(Collections.emptyMap()); List<StoredPassword> filteredEntities = filter.filter("/my/folder/path", new FilterConfiguration(), bundle, filteredBundle); assertEquals(0, filteredEntities.size()); }
@Override public List<StoredPassword> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { List<StoredPassword> passwords = DependencyUtils.filterDependencies(StoredPassword.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())) .stream().filter(e -> e.isType(StoredPassword.Type.PASSWORD)).collect(Collectors.toList()); DependencyUtils.validateEntitiesInList(passwords, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "Password(s)"); return passwords; }
StoredPasswordFilter implements EntityFilter<StoredPassword> { @Override public List<StoredPassword> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { List<StoredPassword> passwords = DependencyUtils.filterDependencies(StoredPassword.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())) .stream().filter(e -> e.isType(StoredPassword.Type.PASSWORD)).collect(Collectors.toList()); DependencyUtils.validateEntitiesInList(passwords, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "Password(s)"); return passwords; } }
StoredPasswordFilter implements EntityFilter<StoredPassword> { @Override public List<StoredPassword> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { List<StoredPassword> passwords = DependencyUtils.filterDependencies(StoredPassword.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())) .stream().filter(e -> e.isType(StoredPassword.Type.PASSWORD)).collect(Collectors.toList()); DependencyUtils.validateEntitiesInList(passwords, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "Password(s)"); return passwords; }  }
StoredPasswordFilter implements EntityFilter<StoredPassword> { @Override public List<StoredPassword> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { List<StoredPassword> passwords = DependencyUtils.filterDependencies(StoredPassword.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())) .stream().filter(e -> e.isType(StoredPassword.Type.PASSWORD)).collect(Collectors.toList()); DependencyUtils.validateEntitiesInList(passwords, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "Password(s)"); return passwords; }  @Override @NotNull Collection<Class<? extends EntityFilter>> getDependencyEntityFilters(); @Override List<StoredPassword> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle); @Override String getFilterableEntityName(); }
StoredPasswordFilter implements EntityFilter<StoredPassword> { @Override public List<StoredPassword> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { List<StoredPassword> passwords = DependencyUtils.filterDependencies(StoredPassword.class, bundle, filteredBundle, e -> filterConfiguration.getRequiredEntityNames(ENTITY_NAME).contains(e.getName())) .stream().filter(e -> e.isType(StoredPassword.Type.PASSWORD)).collect(Collectors.toList()); DependencyUtils.validateEntitiesInList(passwords, filterConfiguration.getRequiredEntityNames(ENTITY_NAME), "Password(s)"); return passwords; }  @Override @NotNull Collection<Class<? extends EntityFilter>> getDependencyEntityFilters(); @Override List<StoredPassword> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle); @Override String getFilterableEntityName();  }