Search in sources :

Example 66 with MostUsefulConfiguration

use of org.jbehave.core.configuration.MostUsefulConfiguration in project jbehave-core by jbehave.

the class ScalaStepsFactoryBehaviour method shouldCreateStepsInstancesFromScalaWhenAnnotated.

@Test
public void shouldCreateStepsInstancesFromScalaWhenAnnotated() {
    ScalaContext context = new ScalaContext("AnnotatedSteps", "NonAnnotatedSteps");
    ScalaStepsFactory factory = new ScalaStepsFactory(new MostUsefulConfiguration(), context);
    List<Class<?>> types = factory.stepsTypes();
    MatcherAssert.assertThat(types.size(), Matchers.equalTo(1));
    assertThat(types.get(0).getSimpleName(), equalTo("AnnotatedSteps"));
    Object object = factory.createInstanceOfType(context.newInstance("AnnotatedSteps").getClass());
    assertThat(object.getClass().getName(), equalTo("AnnotatedSteps"));
}
Also used : MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) ScalaContext(org.jbehave.core.configuration.scala.ScalaContext) Test(org.junit.Test)

Aggregations

MostUsefulConfiguration (org.jbehave.core.configuration.MostUsefulConfiguration)66 Test (org.junit.Test)52 Configuration (org.jbehave.core.configuration.Configuration)14 CandidateSteps (org.jbehave.core.steps.CandidateSteps)14 StoryReporterBuilder (org.jbehave.core.reporters.StoryReporterBuilder)11 LoadFromClasspath (org.jbehave.core.io.LoadFromClasspath)8 TableTransformers (org.jbehave.core.model.TableTransformers)8 Method (java.lang.reflect.Method)7 LocalizedKeywords (org.jbehave.core.i18n.LocalizedKeywords)7 ParameterConverters (org.jbehave.core.steps.ParameterConverters)7 SimpleDateFormat (java.text.SimpleDateFormat)5 HashMap (java.util.HashMap)5 InjectableEmbedder (org.jbehave.core.InjectableEmbedder)5 UsingEmbedder (org.jbehave.core.annotations.UsingEmbedder)5 BeforeOrAfterFailed (org.jbehave.core.failures.BeforeOrAfterFailed)5 Failed (org.jbehave.core.steps.AbstractStepResult.Failed)5 ApplicationContext (org.springframework.context.ApplicationContext)5 ByteArrayOutputStream (java.io.ByteArrayOutputStream)4 OutputStream (java.io.OutputStream)4 PrintStream (java.io.PrintStream)4