Package io.cucumber.spring
Annotation Type CucumberContextConfiguration
@Retention(RUNTIME)
@Target(TYPE)
@API(status=STABLE)
public @interface CucumberContextConfiguration
This annotation is used on a configuration class to make the Cucumber aware
of the test configuration. This is to be used in conjunction with
@ContextConfiguration
, @ContextHierarchy
or
@BootstrapWith
. In case of SpringBoot, the configuration class can be
annotated as follows:
@CucumberContextConfiguration @SpringBootTest(classes = TestConfig.class) public class CucumberSpringConfiguration { }Notes:
- Only one glue class should be annotated with
@CucumberContextConfiguration
otherwise an exception will be thrown. - Cucumber Spring uses Spring's
TestContextManager
framework internally. As a result a single Cucumber scenario will mostly behave like a JUnit test.