AbstractTreePermission implements TreePermission { @Override public boolean isGranted(long permissions) { return getPermissionProvider().isGranted(tree, null, permissions); } AbstractTreePermission(@NotNull Tree tree, @NotNull TreeType type); @Override @NotNull TreePermission getChildPermission(@NotNull String childName, @NotNull NodeState childState); @Override boolean canRead(); @Override boolean canRead(@NotNull PropertyState property); @Override boolean canReadAll(); @Override boolean canReadProperties(); @Override boolean isGranted(long permissions); @Override boolean isGranted(long permissions, @NotNull PropertyState property);  }
@Test public void testIsGranted() { AbstractTreePermission atp = createAbstractTreePermission(tree, TreeType.ACCESS_CONTROL, pp); atp.isGranted(Permissions.ALL); verify(pp, times(1)).isGranted(tree, null, Permissions.ALL); }
@Test public void testIsGrantedWithProperty() { PropertyState ps = mock(PropertyState.class); AbstractTreePermission atp = createAbstractTreePermission(tree, TreeType.VERSION, pp); atp.isGranted(Permissions.SET_PROPERTY|Permissions.VERSION_MANAGEMENT, ps); verify(pp, times(1)).isGranted(tree, ps, Permissions.SET_PROPERTY|Permissions.VERSION_MANAGEMENT); verify(pp, never()).isGranted(tree, null, Permissions.SET_PROPERTY|Permissions.VERSION_MANAGEMENT); }