Skip to content

Commit 7d4dbc2

Browse files
Improve Javadoc on CucumberContextConfiguration (#2738)
Co-authored-by: M.P. Korstanje <[email protected]>
1 parent 9b38f0f commit 7d4dbc2

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

cucumber-spring/src/main/java/io/cucumber/spring/CucumberContextConfiguration.java

+23-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,29 @@
88
import java.lang.annotation.Target;
99

1010
/**
11-
* Configure an application context class that Cucumber should use
11+
* This annotation is used on a configuration class to make the Cucumber aware
12+
* of the test configuration. This is to be used in conjunction with
13+
* {@code @ContextConfiguration}, {@code @ContextHierarchy} or
14+
* {@code @BootstrapWith}. In case of SpringBoot, the configuration class can be
15+
* annotated as follows:
16+
* <p>
17+
*
18+
* <pre>
19+
* &#64;CucumberContextConfiguration
20+
* &#64;SpringBootTest(classes = TestConfig.class)
21+
* public class CucumberSpringConfiguration {
22+
* }
23+
* </pre>
24+
*
25+
* Notes:
26+
* <ul>
27+
* <li>Only one glue class should be annotated with
28+
* {@code @CucumberContextConfiguration} otherwise an exception will be
29+
* thrown.</li>
30+
* <li>Cucumber Spring uses Spring's {@code TestContextManager} framework
31+
* internally. As a result a single Cucumber scenario will mostly behave like a
32+
* JUnit test.</li>
33+
* </ul>
1234
*/
1335
@Retention(RetentionPolicy.RUNTIME)
1436
@Target(ElementType.TYPE)

0 commit comments

Comments
 (0)