Search in sources :

Example 11 with InjectableStepsFactory

use of org.jbehave.core.steps.InjectableStepsFactory in project jbehave-core by jbehave.

the class NeedleStepsFactoryBehaviour method stepsShouldBeCreated.

@Test
public void stepsShouldBeCreated() throws NoSuchFieldException, IllegalAccessException {
    // Given
    final InjectableStepsFactory factory = new NeedleStepsFactory(new MostUsefulConfiguration(), FooSteps.class);
    // When
    List<CandidateSteps> steps = factory.createCandidateSteps();
    // Then
    assertThat(steps.size(), equalTo(1));
    boolean actual1 = steps.get(0) instanceof CandidateSteps;
    assertThat(actual1, is(true));
    Object instance = stepsInstance(steps.get(0));
    boolean actual = instance instanceof FooSteps;
    assertThat(actual, is(true));
}
Also used : InjectableStepsFactory(org.jbehave.core.steps.InjectableStepsFactory) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) CandidateSteps(org.jbehave.core.steps.CandidateSteps) Test(org.junit.Test)

Aggregations

InjectableStepsFactory (org.jbehave.core.steps.InjectableStepsFactory)11 MostUsefulConfiguration (org.jbehave.core.configuration.MostUsefulConfiguration)9 Test (org.junit.Test)9 ArrayList (java.util.ArrayList)8 ByteArrayOutputStream (java.io.ByteArrayOutputStream)7 OutputStream (java.io.OutputStream)7 PrintStream (java.io.PrintStream)7 HashMap (java.util.HashMap)7 Matchers.containsString (org.hamcrest.Matchers.containsString)7 InjectableEmbedder (org.jbehave.core.InjectableEmbedder)7 UsingEmbedder (org.jbehave.core.annotations.UsingEmbedder)7 Configuration (org.jbehave.core.configuration.Configuration)7 RunContext (org.jbehave.core.embedder.PerformableTree.RunContext)7 BatchFailures (org.jbehave.core.failures.BatchFailures)7 StoryPathResolver (org.jbehave.core.io.StoryPathResolver)7 JUnitStory (org.jbehave.core.junit.JUnitStory)7 Story (org.jbehave.core.model.Story)7 CandidateSteps (org.jbehave.core.steps.CandidateSteps)3 StoryReporter (org.jbehave.core.reporters.StoryReporter)2 ExtendedEmbedder (net.serenitybdd.jbehave.embedders.ExtendedEmbedder)1