VersionTreePermission implements TreePermission, VersionConstants { @Override public boolean canRead() { return versionablePermission.canRead(); } 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 testCanRead() { TreePermission versionableTreePermission = mock(TreePermission.class); VersionTreePermission vtp = new VersionTreePermission(mock(Tree.class), versionableTreePermission, getTreeProvider()); vtp.canRead(); verify(versionableTreePermission, times(1)).canRead(); }
@Test public void testCanReadProperty() { TreePermission versionableTreePermission = mock(TreePermission.class); VersionTreePermission vtp = new VersionTreePermission(mock(Tree.class), versionableTreePermission, getTreeProvider()); PropertyState ps = mock(PropertyState.class); vtp.canRead(ps); verify(versionableTreePermission, times(1)).canRead(ps); }