@Test @SuppressWarnings("unchecked") public void testUndo() { tested.execute(graphCommandExecutionContext); reset(content); when(content.getDefinition()).thenReturn(NEW_DEFINITION); CommandResult<RuleViolation> result = tested.undo(graphCommandExecutionContext); assertEquals(CommandResult.Type.INFO, result.getType()); verify(content).setDefinition(eq(CURRENT_DEFINITION)); assertEquals(1, labels.size()); assertTrue(labels.contains(CURRENT_DEFINITION_ID)); }
@Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context) { final MorphNodeCommand undoCommand = new MorphNodeCommand(uuid, morphDefinition, oldMorphTarget); return undoCommand.execute(context); }
MorphNodeCommand extends AbstractGraphCommand { @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context) { final MorphNodeCommand undoCommand = new MorphNodeCommand(uuid, morphDefinition, oldMorphTarget); return undoCommand.execute(context); } }
MorphNodeCommand extends AbstractGraphCommand { @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context) { final MorphNodeCommand undoCommand = new MorphNodeCommand(uuid, morphDefinition, oldMorphTarget); return undoCommand.execute(context); } MorphNodeCommand(final @MapsTo("uuid") String uuid,
                            final @MapsTo("morphDefinition") MorphDefinition morphDefinition,
                            final @MapsTo("morphTarget") String morphTarget);  MorphNodeCommand(final Node<Definition, Edge> candidate,
                            final MorphDefinition morphDefinition,
                            final String morphTarget); }
MorphNodeCommand extends AbstractGraphCommand { @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context) { final MorphNodeCommand undoCommand = new MorphNodeCommand(uuid, morphDefinition, oldMorphTarget); return undoCommand.execute(context); } MorphNodeCommand(final @MapsTo("uuid") String uuid,
                            final @MapsTo("morphDefinition") MorphDefinition morphDefinition,
                            final @MapsTo("morphTarget") String morphTarget);  MorphNodeCommand(final Node<Definition, Edge> candidate,
                            final MorphDefinition morphDefinition,
                            final String morphTarget); @Override @SuppressWarnings("unchecked") CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context); @Override CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context); @Override String toString(); }
MorphNodeCommand extends AbstractGraphCommand { @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context) { final MorphNodeCommand undoCommand = new MorphNodeCommand(uuid, morphDefinition, oldMorphTarget); return undoCommand.execute(context); } MorphNodeCommand(final @MapsTo("uuid") String uuid,
                            final @MapsTo("morphDefinition") MorphDefinition morphDefinition,
                            final @MapsTo("morphTarget") String morphTarget);  MorphNodeCommand(final Node<Definition, Edge> candidate,
                            final MorphDefinition morphDefinition,
                            final String morphTarget); @Override @SuppressWarnings("unchecked") CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context); @Override CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context); @Override String toString();  }