In addition to providing generic and extensible testing infrastructure, the Spring TestContext Framework provides out-of-the-box support for Spring-specific integration testing functionality such as context management and caching, dependency injection of test fixtures, and transactional test management with default rollback semantics.
ActiveProfilesis a class-level annotation that is used to declare which active bean definition profiles should be used when loading an
ApplicationContextfor test classes.Strategy interface for programmatically resolving which active bean definition profiles should be used when loading an
ApplicationContextfor a test class.Strategy for components that process failures related to application contexts within the Spring TestContext Framework.
BootstrapContextencapsulates the context in which the Spring TestContext Framework is bootstrapped.
BootstrapUtilsis a collection of utility methods to assist with bootstrapping the Spring TestContext Framework.
@BootstrapWithdefines class-level metadata that is used to determine how to bootstrap the Spring TestContext Framework.
@ContextConfigurationdefines class-level metadata that is used to determine how to load and configure an
ApplicationContextfor integration tests.
ContextConfigurationAttributesencapsulates the context configuration attributes declared via
@ContextConfiguration.Strategy interface for customizing
application contextsthat are created and managed by the Spring TestContext Framework.Factory for creating
@ContextHierarchyis a class-level annotation that is used to define a hierarchy of
ApplicationContextsfor integration tests.Strategy interface for loading an
ApplicationContextfor an integration test managed by the Spring TestContext Framework.Registry used with
@DynamicPropertySourcemethods so that they can add properties to the
Environmentthat have dynamically resolved values.Method-level annotation for integration tests that need to add properties with dynamic values to the
Environment's set of
@NestedTestConfigurationis a type-level annotation that is used to configure how Spring test configuration annotations are processed within enclosing class hierarchies (i.e., for inner test classes).Enumeration of modes that dictate how test configuration from enclosing classes is processed for inner test classes.Strategy interface for loading an
ApplicationContextfor an integration test managed by the Spring TestContext Framework.
@TestConstructoris a type-level annotation that is used to configure how the parameters of a test class constructor are autowired from components in the test's
ApplicationContext.Defines autowiring modes for parameters in a test constructor.
TestContextencapsulates the context in which a test is executed, agnostic of the actual testing framework in use.Untyped extension of
TestContextAnnotationUtils.AnnotationDescriptorthat is used to describe the declaration of one of several candidate annotation types where the actual annotation type cannot be predetermined.
TestContextBootstrapperdefines the SPI for bootstrapping the Spring TestContext Framework.
TestContextManageris the main entry point into the Spring TestContext Framework.
TestExecutionListenerdefines a listener API for reacting to test execution events published by the
TestContextManagerwith which the listener is registered.Enumeration of modes that dictate whether explicitly declared listeners are merged with the default listeners when
@TestExecutionListenersis declared on a class that does not inherit listeners from a superclass or enclosing class.
@TestPropertySourcesis a container for one or more