io.cucumber.plugin.event.TestStepFinished Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cucumber-plugin Show documentation
Show all versions of cucumber-plugin Show documentation
Plugin interface for Cucumber-JVM
package io.cucumber.plugin.event;
import org.apiguardian.api.API;
import java.time.Instant;
import java.util.Objects;
/**
* A test step finished event is broadcast when ever a step finishes.
*
* A step can either be a {@link PickleStepTestStep} or a {@link HookTestStep}
* depending on what step was executed.
*
* Each test step finished event is followed by an matching
* {@link TestStepStarted} event for the same step.The order in which these
* events may be expected is:
*
*
* [before hook,]* [[before step hook,]* test step, [after step hook,]*]+, [after hook,]*
*
*
* @see PickleStepTestStep
* @see HookTestStep
*/
@API(status = API.Status.STABLE)
public final class TestStepFinished extends TestCaseEvent {
private final TestStep testStep;
private final Result result;
public TestStepFinished(Instant timeInstant, TestCase testCase, TestStep testStep, Result result) {
super(timeInstant, testCase);
this.testStep = Objects.requireNonNull(testStep);
this.result = Objects.requireNonNull(result);
}
public Result getResult() {
return result;
}
public TestStep getTestStep() {
return testStep;
}
}