@Test public void testNextNode() throws Exception { NodeIterator delegate = mock(NodeIterator.class); NodeIteratorFacade<Session> facade = getFacade(delegate); final Node value = mock(Node.class); final String path = "/correct/path"; when(value.getPath()).thenReturn(path); when(delegate.nextNode()).thenReturn(value); final Node fromFacade = facade.nextNode(); assertEquals("same path", path, fromFacade.getPath()); assertTrue("is facade", fromFacade instanceof NodeFacade); }
@Override public Node nextNode() { Node internalNode = delegate.nextNode(); return NodeFacade.wrap(internalNode, session); }
NodeIteratorFacade extends RangeIteratorFacade<NodeIterator> implements NodeIterator { @Override public Node nextNode() { Node internalNode = delegate.nextNode(); return NodeFacade.wrap(internalNode, session); } }
NodeIteratorFacade extends RangeIteratorFacade<NodeIterator> implements NodeIterator { @Override public Node nextNode() { Node internalNode = delegate.nextNode(); return NodeFacade.wrap(internalNode, session); } NodeIteratorFacade(final @NotNull NodeIterator delegate,
                              final @NotNull SessionFacade<S> session); }
NodeIteratorFacade extends RangeIteratorFacade<NodeIterator> implements NodeIterator { @Override public Node nextNode() { Node internalNode = delegate.nextNode(); return NodeFacade.wrap(internalNode, session); } NodeIteratorFacade(final @NotNull NodeIterator delegate,
                              final @NotNull SessionFacade<S> session); @Override Node nextNode(); @Override Object next(); }
NodeIteratorFacade extends RangeIteratorFacade<NodeIterator> implements NodeIterator { @Override public Node nextNode() { Node internalNode = delegate.nextNode(); return NodeFacade.wrap(internalNode, session); } NodeIteratorFacade(final @NotNull NodeIterator delegate,
                              final @NotNull SessionFacade<S> session); @Override Node nextNode(); @Override Object next();  }