VersionTreePermission implements TreePermission, VersionConstants { @Override public boolean isGranted(long permissions) { return versionablePermission.isGranted(permissions); } VersionTreePermission(@NotNull Tree versionTree, @NotNull TreePermission versionablePermission, @NotNull TreeProvider treeProvider); @NotNull @Override 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() { TreePermission versionableTreePermission = mock(TreePermission.class); VersionTreePermission vtp = new VersionTreePermission(mock(Tree.class), versionableTreePermission, getTreeProvider()); vtp.isGranted(Permissions.ALL); verify(versionableTreePermission, times(1)).isGranted(Permissions.ALL); }
@Test public void testIsGrantedProperty() { TreePermission versionableTreePermission = mock(TreePermission.class); VersionTreePermission vtp = new VersionTreePermission(mock(Tree.class), versionableTreePermission, getTreeProvider()); PropertyState ps = mock(PropertyState.class); vtp.isGranted(Permissions.ALL, ps); verify(versionableTreePermission, times(1)).isGranted(Permissions.ALL, ps); }