ItemWrappingVisitor implements ItemVisitor { @Override public void visit(Property property) throws RepositoryException { delegate.visit(new PropertyFacade<>(property, session)); } @SuppressWarnings("WeakerAccess")  ItemWrappingVisitor(final @NotNull ItemVisitor delegate,
                               final @NotNull SessionFacade<S> session); @Override void visit(Property property); @Override void visit(Node node);  }
@Test public void testVisitProperty() throws Exception { final String path = "/correct/path"; ItemVisitor visitor = new FacadeTestingItemVisitor(path); ItemWrappingVisitor<Session> facade = getFacade(visitor); Property delegate = mock(Property.class); when(delegate.getPath()).thenReturn(path); facade.visit(delegate); }
@Test public void testVisitNode() throws Exception { final String path = "/correct/path"; ItemVisitor visitor = new FacadeTestingItemVisitor(path); ItemWrappingVisitor<Session> facade = getFacade(visitor); Node delegate = mock(Node.class); when(delegate.getPath()).thenReturn(path); facade.visit(delegate); }