AbstractRestrictionProvider implements RestrictionProvider, AccessControlConstants { @NotNull @Override public Set<RestrictionDefinition> getSupportedRestrictions(String oakPath) { if (isUnsupportedPath(oakPath)) { return Collections.emptySet(); } else { return ImmutableSet.copyOf(supported.values()); } } AbstractRestrictionProvider(@NotNull Map<String, ? extends RestrictionDefinition> definitions); @NotNull @Override Set<RestrictionDefinition> getSupportedRestrictions(String oakPath); @NotNull @Override Restriction createRestriction(String oakPath, @NotNull String oakName, @NotNull Value value); @NotNull @Override Restriction createRestriction(String oakPath, @NotNull String oakName, @NotNull Value... values); @NotNull @Override Set<Restriction> readRestrictions(String oakPath, @NotNull Tree aceTree); @Override void writeRestrictions(String oakPath, Tree aceTree, Set<Restriction> restrictions); @Override void validateRestrictions(String oakPath, @NotNull Tree aceTree);  }
@Test public void testGetSupportedRestrictions() { Set<RestrictionDefinition> defs = restrictionProvider.getSupportedRestrictions(testPath); assertNotNull(defs); assertEquals(supported.size(), defs.size()); for (RestrictionDefinition def : supported.values()) { assertTrue(defs.contains(def)); } }
@Test public void testGetSupportedRestrictionsForUnsupportedPath() { Set<RestrictionDefinition> defs = restrictionProvider.getSupportedRestrictions(unsupportedPath); assertNotNull(defs); assertTrue(defs.isEmpty()); }