use of org.jbehave.core.configuration.AnnotationBuilder in project jbehave-core by jbehave.
the class GuiceAnnotationBuilderBehaviour method shouldBuildConfigurationFromAnnotationsUsingInjectorWithoutParent.
@Test
public void shouldBuildConfigurationFromAnnotationsUsingInjectorWithoutParent() {
AnnotationBuilder builderAnnotated = new GuiceAnnotationBuilder(AnnotatedUsingConfigureAndGuiceConverters.class) {
@Override
protected Injector createInjector(List<Module> modules) {
return Guice.createInjector(modules);
}
};
Configuration configuration = builderAnnotated.buildConfiguration();
assertThatCustomObjectIsConverted(configuration.parameterConverters());
assertThatDateIsConvertedWithFormat(configuration.parameterConverters(), new SimpleDateFormat("yyyy-MM-dd"));
assertThatExamplesTableIsConverted(configuration.parameterConverters());
}
use of org.jbehave.core.configuration.AnnotationBuilder in project jbehave-core by jbehave.
the class GuiceAnnotationBuilderBehaviour method shouldNotBuildContainerIfModuleNotInstantiable.
@Test
public void shouldNotBuildContainerIfModuleNotInstantiable() {
AnnotationMonitor annotationMonitor = mock(AnnotationMonitor.class);
AnnotationBuilder builderPrivateModule = new GuiceAnnotationBuilder(AnnotatedWithPrivateModule.class, annotationMonitor);
assertThatStepsInstancesAre(builderPrivateModule.buildCandidateSteps());
verify(annotationMonitor).elementCreationFailed(isA(Class.class), isA(Exception.class));
}
use of org.jbehave.core.configuration.AnnotationBuilder in project jbehave-core by jbehave.
the class GuiceAnnotationBuilderBehaviour method shouldBuildCandidateStepsFromAnnotationsUsingStepsAndInheritingGuiceFromParent.
@Test
public void shouldBuildCandidateStepsFromAnnotationsUsingStepsAndInheritingGuiceFromParent() {
AnnotationBuilder builderAnnotated = new GuiceAnnotationBuilder(InheritingAnnotatedUsingSteps.class);
Configuration configuration = builderAnnotated.buildConfiguration();
assertThatStepsInstancesAre(builderAnnotated.buildCandidateSteps(configuration), FooSteps.class);
}
use of org.jbehave.core.configuration.AnnotationBuilder in project jbehave-core by jbehave.
the class GuiceAnnotationBuilderBehaviour method shouldBuildCandidateStepsFromAnnotationsUsingStepsAndGuice.
@Test
public void shouldBuildCandidateStepsFromAnnotationsUsingStepsAndGuice() {
AnnotationBuilder builderAnnotated = new GuiceAnnotationBuilder(AnnotatedUsingStepsAndGuice.class);
Configuration configuration = builderAnnotated.buildConfiguration();
assertThatStepsInstancesAre(builderAnnotated.buildCandidateSteps(configuration), FooSteps.class);
}
use of org.jbehave.core.configuration.AnnotationBuilder in project jbehave-core by jbehave.
the class GuiceAnnotationBuilderBehaviour method shouldBuildConfigurationFromAnnotationsUsingConfigureAndGuiceConverters.
@Test
public void shouldBuildConfigurationFromAnnotationsUsingConfigureAndGuiceConverters() {
AnnotationBuilder builderAnnotated = new GuiceAnnotationBuilder(AnnotatedUsingConfigureAndGuiceConverters.class);
Configuration configuration = builderAnnotated.buildConfiguration();
assertThatCustomObjectIsConverted(configuration.parameterConverters());
assertThatDateIsConvertedWithFormat(configuration.parameterConverters(), new SimpleDateFormat("yyyy-MM-dd"));
assertThatExamplesTableIsConverted(configuration.parameterConverters());
}
Aggregations