@Test @SuppressWarnings("unchecked") public void testUndo() { tested.removed = node; CommandResult<RuleViolation> result = tested.undo(graphCommandExecutionContext); assertEquals(CommandResult.Type.INFO, result.getType()); verify(graph, times(2)).addNode(any(Node.class)); verify(graphIndex, times(1)).addNode(any(Node.class)); verify(graph, times(0)).removeNode(eq(UUID)); verify(graphIndex, times(0)).removeNode(eq(node)); verify(graphIndex, times(0)).removeEdge(any(Edge.class)); verify(graphIndex, times(0)).addEdge(any(Edge.class)); }
@Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context) { final AddNodeCommand undoCommand = new AddNodeCommand(getRemoved()); return undoCommand.execute(context); }
DeleteNodeCommand extends DeregisterNodeCommand { @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context) { final AddNodeCommand undoCommand = new AddNodeCommand(getRemoved()); return undoCommand.execute(context); } }
DeleteNodeCommand extends DeregisterNodeCommand { @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context) { final AddNodeCommand undoCommand = new AddNodeCommand(getRemoved()); return undoCommand.execute(context); } DeleteNodeCommand(final @MapsTo("uuid") String uuid);  DeleteNodeCommand(final Node<?, Edge> node); }
DeleteNodeCommand extends DeregisterNodeCommand { @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context) { final AddNodeCommand undoCommand = new AddNodeCommand(getRemoved()); return undoCommand.execute(context); } DeleteNodeCommand(final @MapsTo("uuid") String uuid);  DeleteNodeCommand(final Node<?, Edge> node); @Override CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context); @Override String toString(); }
DeleteNodeCommand extends DeregisterNodeCommand { @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context) { final AddNodeCommand undoCommand = new AddNodeCommand(getRemoved()); return undoCommand.execute(context); } DeleteNodeCommand(final @MapsTo("uuid") String uuid);  DeleteNodeCommand(final Node<?, Edge> node); @Override CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context); @Override String toString();  }