use of org.jbehave.core.InjectableEmbedder in project jbehave-core by jbehave.
the class AnnotationBuilderBehaviour method shouldCreateEmbeddableInstanceFromInjectableEmbedderWithoutStepsFactory.
@Test
public void shouldCreateEmbeddableInstanceFromInjectableEmbedderWithoutStepsFactory() {
AnnotationBuilder annotatedInjectable = new AnnotationBuilder(AnnotedInjectableWithoutStepsFactory.class);
Object instance = annotatedInjectable.embeddableInstance();
assertThat(instance, Matchers.instanceOf(InjectableEmbedder.class));
Embedder embedder = ((InjectableEmbedder) instance).injectedEmbedder();
assertThat(embedder.configuration().keywords(), instanceOf(MyKeywords.class));
assertThat(embedder.metaFilters(), equalTo(asList("+embedder injectable")));
assertThatStepsInstancesAre(embedder.candidateSteps(), MySteps.class);
}
use of org.jbehave.core.InjectableEmbedder in project jbehave-core by jbehave.
the class AnnotationBuilderBehaviour method shouldCreateEmbeddableInstanceFromInjectableEmbedder.
@Test
public void shouldCreateEmbeddableInstanceFromInjectableEmbedder() {
AnnotationBuilder annotatedInjectable = new AnnotationBuilder(AnnotedInjectable.class);
Object instance = annotatedInjectable.embeddableInstance();
assertThat(instance, Matchers.instanceOf(InjectableEmbedder.class));
Embedder embedder = ((InjectableEmbedder) instance).injectedEmbedder();
assertThat(embedder.configuration().keywords(), instanceOf(MyKeywords.class));
assertThat(embedder.metaFilters(), equalTo(asList("+embedder injectable")));
assertThat(embedder.systemProperties().getProperty("one"), equalTo("One"));
assertThat(embedder.systemProperties().getProperty("two"), equalTo("Two"));
assertThatStepsInstancesAre(embedder.stepsFactory().createCandidateSteps(), MySteps.class);
}
Aggregations