@Target([AnnotationTarget.CLASS, AnnotationTarget.FILE]) @Inherited class WebAppConfiguration
@WebAppConfiguration
is a class-level annotation that is used to declare that the ApplicationContext
loaded for an integration test should be a org.springframework.web.context.WebApplicationContext.
The presence of @WebAppConfiguration
on a test class indicates that a WebApplicationContext
should be loaded for the test using a default for the path to the root of the web application. To override the default, specify an explicit resource path via the #value
attribute.
Note that @WebAppConfiguration
must be used in conjunction with org.springframework.test.context.ContextConfiguration, either within a single test class or within a test class hierarchy.
As of Spring Framework 4.0, this annotation may be used as a meta-annotation to create custom composed annotations.
Author
Sam Brannen
Since
3.2
See Also
org.springframework.web.context.WebApplicationContextorg.springframework.test.context.ContextConfigurationServletTestExecutionListener
WebAppConfiguration(value: String)
The presence of Note that As of Spring Framework 4.0, this annotation may be used as a meta-annotation to create custom composed annotations. |
val value: String
The resource path to the root directory of the web application. A path that does not include a Spring resource prefix (e.g., Defaults to |