Search in sources :

Example 6 with ScenarioType

use of org.jbehave.core.annotations.ScenarioType in project jbehave-core by jbehave.

the class StepsBehaviour method assertFailureReturnedOnStepsPerformed.

private void assertFailureReturnedOnStepsPerformed(Steps steps) {
    ScenarioType scenarioType = ScenarioType.NORMAL;
    List<BeforeOrAfterStep> beforeOrAfterStepList = steps.listBeforeOrAfterScenario(scenarioType);
    StepResult stepResult = beforeOrAfterStepList.get(0).createStep().perform(null);
    assertThat(stepResult, instanceOf(Failed.class));
    assertThat(stepResult.getFailure(), instanceOf(UUIDExceptionWrapper.class));
    assertThat(stepResult.getFailure().getCause(), instanceOf(BeforeOrAfterFailed.class));
}
Also used : BeforeOrAfterFailed(org.jbehave.core.failures.BeforeOrAfterFailed) Failed(org.jbehave.core.steps.AbstractStepResult.Failed) ScenarioType(org.jbehave.core.annotations.ScenarioType) UUIDExceptionWrapper(org.jbehave.core.failures.UUIDExceptionWrapper) BeforeOrAfterFailed(org.jbehave.core.failures.BeforeOrAfterFailed)

Aggregations

ScenarioType (org.jbehave.core.annotations.ScenarioType)6 Test (org.junit.Test)5 Meta (org.jbehave.core.model.Meta)3 UUIDExceptionWrapper (org.jbehave.core.failures.UUIDExceptionWrapper)2 BeforeOrAfterFailed (org.jbehave.core.failures.BeforeOrAfterFailed)1 Failed (org.jbehave.core.steps.AbstractStepResult.Failed)1