public State run(Step step) { if (step instanceof ParameterisedStep) { ((ParameterisedStep) step).describeTo(reporter.get()); } UUIDExceptionWrapper storyFailureIfItHappened = storyFailure.get(); StepResult result = step.perform(storyFailureIfItHappened); result.describeTo(reporter.get()); UUIDExceptionWrapper stepFailure = result.getFailure(); if (stepFailure == null) { return this; } storyFailure.set(mostImportantOf(storyFailureIfItHappened, stepFailure)); currentStrategy.set(strategyFor(storyFailure.get())); return new SomethingHappened(stepFailure); }
public State run(Step step) { StepResult result = step.doNotPerform(scenarioFailure); result.describeTo(reporter.get()); return this; }