use of org.jbehave.core.steps.Steps in project jbehave-core by jbehave.
the class AnnotationBuilderBehaviour method assertThatStepsInstancesAre.
private void assertThatStepsInstancesAre(List<CandidateSteps> candidateSteps, Class<?>... stepsClasses) {
for (Class<?> stepsClass : stepsClasses) {
boolean found = false;
for (CandidateSteps steps : candidateSteps) {
Object instance = ((Steps) steps).instance();
if (instance.getClass() == stepsClass) {
found = true;
}
}
assertThat(found, is(true));
}
}
use of org.jbehave.core.steps.Steps in project jbehave-core by jbehave.
the class NeedleStepsFactory method createCandidateSteps.
/**
* {@inheritDoc}
*/
public List<CandidateSteps> createCandidateSteps() {
final List<CandidateSteps> result = new ArrayList<>();
for (final Class<?> type : steps) {
if (hasAnnotatedMethods(type)) {
configuration.parameterConverters().addConverters(methodReturningConverters(type));
result.add(new Steps(configuration, type, this));
}
}
return result;
}
use of org.jbehave.core.steps.Steps in project jbehave-core by jbehave.
the class NeedleAnnotationBuilderBehaviour method assertThatStepsInstancesAre.
private void assertThatStepsInstancesAre(final List<CandidateSteps> candidateSteps, final Class<?>... stepsClasses) {
assertThat(candidateSteps.size(), equalTo(stepsClasses.length));
// transform candidateSteps to Set of classes
final Set<Class<?>> candidateStepClasses = new HashSet<>();
for (final CandidateSteps step : candidateSteps) {
candidateStepClasses.add(((Steps) step).instance().getClass());
}
assertThat(candidateStepClasses, hasItems(stepsClasses));
}
Aggregations