AbstractScenarioSimulationCommand extends AbstractCommand<ScenarioSimulationContext, ScenarioSimulationViolation> { @Override public CommandResult<ScenarioSimulationViolation> execute(ScenarioSimulationContext context) { context.setStatusSimulationIfEmpty(); try { internalExecute(context); return commonExecution(context); } catch (Exception e) { return new CommandResultImpl<>(CommandResult.Type.ERROR, Collections.singleton(new ScenarioSimulationViolation(e.getMessage()))); } } protected  AbstractScenarioSimulationCommand(); long getId(); @Override CommandResult<ScenarioSimulationViolation> undo(ScenarioSimulationContext context); @Override CommandResult<ScenarioSimulationViolation> execute(ScenarioSimulationContext context);  }
@Test public void execute() { command.execute(scenarioSimulationContextLocal); try { verify(command, times(1)).internalExecute(eq(scenarioSimulationContextLocal)); } catch (Exception e) { fail(e.getMessage()); } }