Annotation Interface SpringJUnitWebConfig
@ExtendWith(SpringExtension.class)
@ContextConfiguration
@WebAppConfiguration
@Documented
@Inherited
@Retention(RUNTIME)
@Target(TYPE)
public @interface SpringJUnitWebConfig
@SpringJUnitWebConfig
is a composed annotation that combines
@ExtendWith(SpringExtension.class)
from JUnit Jupiter with
@ContextConfiguration
and
@WebAppConfiguration
from the Spring TestContext
Framework.
As of Spring Framework 5.3, this annotation will effectively be inherited
from an enclosing test class by default. See
@NestedTestConfiguration
for details.
- Since:
- 5.0
- Author:
- Sam Brannen
- See Also:
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionClass<?>[]
Alias forContextConfiguration.classes()
.boolean
Alias forContextConfiguration.inheritInitializers()
.boolean
Alias forContextConfiguration.inheritLocations()
.Class<? extends ApplicationContextInitializer<?>>[]
Alias forContextConfiguration.initializers()
.String[]
Alias forContextConfiguration.locations()
.Alias forContextConfiguration.name()
.Alias forWebAppConfiguration.value()
.Class<?>[]
Alias forContextConfiguration.classes()
.
-
Element Details
-
value
Alias forContextConfiguration.classes()
.- Default:
- {}
-
classes
Alias forContextConfiguration.classes()
.- Default:
- {}
-
locations
Alias forContextConfiguration.locations()
.- Default:
- {}
-
initializers
@AliasFor(annotation=ContextConfiguration.class) Class<? extends ApplicationContextInitializer<?>>[] initializersAlias forContextConfiguration.initializers()
.- Default:
- {}
-
inheritLocations
Alias forContextConfiguration.inheritLocations()
.- Default:
- true
-
inheritInitializers
Alias forContextConfiguration.inheritInitializers()
.- Default:
- true
-
name
Alias forContextConfiguration.name()
.- Default:
- ""
-
resourcePath
Alias forWebAppConfiguration.value()
.- Default:
- "src/main/webapp"
-