Search in sources :

Example 6 with AnnotationBuilder

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

the class WeldAnnotationBuilderBehaviour method shouldBuildConfigurationFromAnnotationsUsingConfigureAndConverters.

@Test
public void shouldBuildConfigurationFromAnnotationsUsingConfigureAndConverters() {
    AnnotationBuilder builderAnnotated = createBuilder(AnnotatedUsingConfigureAndConverters.class);
    Configuration configuration = builderAnnotated.buildConfiguration();
    assertThatCustomObjectIsConverted(configuration.parameterConverters());
    assertThatDateIsConvertedWithFormat(configuration.parameterConverters(), new SimpleDateFormat("yyyy-MM-dd"));
}
Also used : Configuration(org.jbehave.core.configuration.Configuration) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) AnnotationBuilder(org.jbehave.core.configuration.AnnotationBuilder) SimpleDateFormat(java.text.SimpleDateFormat) Test(org.junit.Test)

Example 7 with AnnotationBuilder

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

the class WeldAnnotationBuilderBehaviour method shouldBuildCandidateStepsFromAnnotationsUsingWeld.

@Test
public void shouldBuildCandidateStepsFromAnnotationsUsingWeld() {
    AnnotationBuilder builderAnnotated = createBuilder(AnnotatedUsingWeld.class);
    Configuration configuration = builderAnnotated.buildConfiguration();
    assertThatStepsInstancesAre(builderAnnotated.buildCandidateSteps(configuration), WeldStepBean.class);
}
Also used : Configuration(org.jbehave.core.configuration.Configuration) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) AnnotationBuilder(org.jbehave.core.configuration.AnnotationBuilder) Test(org.junit.Test)

Example 8 with AnnotationBuilder

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

the class NeedleAnnotationBuilderBehaviour method shouldBuildCandidateStepsFromAnnotationsUsingStepsAndNeedle.

@Test
public void shouldBuildCandidateStepsFromAnnotationsUsingStepsAndNeedle() {
    final AnnotationBuilder builderAnnotated = new NeedleAnnotationBuilder(AnnotatedUsingStepsAndNeedle.class);
    final Configuration configuration = builderAnnotated.buildConfiguration();
    assertThatStepsInstancesAre(builderAnnotated.buildCandidateSteps(configuration), FooSteps.class);
}
Also used : Configuration(org.jbehave.core.configuration.Configuration) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) AnnotationBuilder(org.jbehave.core.configuration.AnnotationBuilder) Test(org.junit.Test)

Example 9 with AnnotationBuilder

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

the class GuiceAnnotationBuilderBehaviour method shouldBuildCandidateStepsFromAnnotationsUsingGuice.

@Test
public void shouldBuildCandidateStepsFromAnnotationsUsingGuice() {
    AnnotationBuilder builderAnnotated = new GuiceAnnotationBuilder(AnnotatedUsingGuice.class);
    Configuration configuration = builderAnnotated.buildConfiguration();
    assertThatStepsInstancesAre(builderAnnotated.buildCandidateSteps(configuration), FooSteps.class, FooStepsWithDependency.class);
}
Also used : Configuration(org.jbehave.core.configuration.Configuration) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) AnnotationBuilder(org.jbehave.core.configuration.AnnotationBuilder) Test(org.junit.Test)

Example 10 with AnnotationBuilder

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

the class GuiceAnnotationBuilderBehaviour method shouldBuildDefaultConfigurationIfAnnotationOrAnnotatedValuesNotPresent.

@Test
public void shouldBuildDefaultConfigurationIfAnnotationOrAnnotatedValuesNotPresent() {
    AnnotationBuilder builderNotAnnotated = new GuiceAnnotationBuilder(NotAnnotated.class);
    assertThatConfigurationIs(builderNotAnnotated.buildConfiguration(), new MostUsefulConfiguration());
    AnnotationBuilder builderAnnotatedWithoutModules = new GuiceAnnotationBuilder(AnnotatedWithoutModules.class);
    assertThatConfigurationIs(builderAnnotatedWithoutModules.buildConfiguration(), new MostUsefulConfiguration());
}
Also used : AnnotationBuilder(org.jbehave.core.configuration.AnnotationBuilder) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) Test(org.junit.Test)

Aggregations

AnnotationBuilder (org.jbehave.core.configuration.AnnotationBuilder)26 Test (org.junit.Test)25 MostUsefulConfiguration (org.jbehave.core.configuration.MostUsefulConfiguration)21 Configuration (org.jbehave.core.configuration.Configuration)18 SimpleDateFormat (java.text.SimpleDateFormat)6 Keywords (org.jbehave.core.configuration.Keywords)2 SilentlyAbsorbingFailure (org.jbehave.core.failures.SilentlyAbsorbingFailure)2 LocalizedKeywords (org.jbehave.core.i18n.LocalizedKeywords)2 LoadFromURL (org.jbehave.core.io.LoadFromURL)2 RegexPrefixCapturingPatternParser (org.jbehave.core.parsers.RegexPrefixCapturingPatternParser)2 ParseException (java.text.ParseException)1 List (java.util.List)1 AnnotationMonitor (org.jbehave.core.configuration.AnnotationMonitor)1 WeldBootstrap (org.jbehave.core.configuration.weld.WeldBootstrap)1 CandidateSteps (org.jbehave.core.steps.CandidateSteps)1