Annotation Interface SpringJUnitConfig
@ExtendWith(SpringExtension.class)
@ContextConfiguration
@Documented
@Inherited
@Retention(RUNTIME)
@Target(TYPE)
public @interface SpringJUnitConfig
@SpringJUnitConfig
is a composed annotation that combines
@ExtendWith(SpringExtension.class)
from JUnit Jupiter with
@ContextConfiguration
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()
.Class<? extends ContextLoader>
Alias forContextConfiguration.loader()
.String[]
Alias forContextConfiguration.locations()
.Alias forContextConfiguration.name()
.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
-
loader
Alias forContextConfiguration.loader()
.- Since:
- 6.1
- Default:
- org.springframework.test.context.ContextLoader.class
-
name
Alias forContextConfiguration.name()
.- Default:
- ""
-