@Test(expected = IllegalStateException.class) public void undoWithoutRestorable() { commandSpy.restorableStatus = null; commandSpy.undo(scenarioSimulationContextLocal); }
@Override public CommandResult<ScenarioSimulationViolation> undo(ScenarioSimulationContext context) { if (restorableStatus == null) { String message = this.getClass().getSimpleName() + "restorableStatus status is null"; throw new IllegalStateException(message); } return setCurrentContext(context); }
AbstractScenarioGridCommand extends AbstractScenarioSimulationCommand { @Override public CommandResult<ScenarioSimulationViolation> undo(ScenarioSimulationContext context) { if (restorableStatus == null) { String message = this.getClass().getSimpleName() + "restorableStatus status is null"; throw new IllegalStateException(message); } return setCurrentContext(context); } }
AbstractScenarioGridCommand extends AbstractScenarioSimulationCommand { @Override public CommandResult<ScenarioSimulationViolation> undo(ScenarioSimulationContext context) { if (restorableStatus == null) { String message = this.getClass().getSimpleName() + "restorableStatus status is null"; throw new IllegalStateException(message); } return setCurrentContext(context); } protected  AbstractScenarioGridCommand(final GridWidget gridWidget); protected  AbstractScenarioGridCommand(); }
AbstractScenarioGridCommand extends AbstractScenarioSimulationCommand { @Override public CommandResult<ScenarioSimulationViolation> undo(ScenarioSimulationContext context) { if (restorableStatus == null) { String message = this.getClass().getSimpleName() + "restorableStatus status is null"; throw new IllegalStateException(message); } return setCurrentContext(context); } protected  AbstractScenarioGridCommand(final GridWidget gridWidget); protected  AbstractScenarioGridCommand(); @Override CommandResult<ScenarioSimulationViolation> execute(ScenarioSimulationContext context); @Override CommandResult<ScenarioSimulationViolation> undo(ScenarioSimulationContext context); CommandResult<ScenarioSimulationViolation> redo(ScenarioSimulationContext context); Optional<CommandResult<ScenarioSimulationViolation>> commonUndoRedoPreexecution(final ScenarioSimulationContext context); }
AbstractScenarioGridCommand extends AbstractScenarioSimulationCommand { @Override public CommandResult<ScenarioSimulationViolation> undo(ScenarioSimulationContext context) { if (restorableStatus == null) { String message = this.getClass().getSimpleName() + "restorableStatus status is null"; throw new IllegalStateException(message); } return setCurrentContext(context); } protected  AbstractScenarioGridCommand(final GridWidget gridWidget); protected  AbstractScenarioGridCommand(); @Override CommandResult<ScenarioSimulationViolation> execute(ScenarioSimulationContext context); @Override CommandResult<ScenarioSimulationViolation> undo(ScenarioSimulationContext context); CommandResult<ScenarioSimulationViolation> redo(ScenarioSimulationContext context); Optional<CommandResult<ScenarioSimulationViolation>> commonUndoRedoPreexecution(final ScenarioSimulationContext context);  }