As of Spring Framework 6.2.13, we support JUnit Jupiter 5.12's ExtensionContextScope.TEST_METHOD behavior in the SpringExtension and the BeanOverrideTestExecutionListener; however, users can only benefit from that if they explicitly set the following configuration parameter for their entire test suite, which may have adverse effects on other third-party JUnit Jupiter extensions. junit.jupiter.extensions.testinstantiation.extensioncontextscope.default=test_method For Spring Framework 7.0, in order to support dependency injection into test class constructors and fields in @Nested test class hierarchies from the same ApplicationContext that is already used to perform dependency injection into lifecycle and test methods (@BeforeEach, @AfterEach, @Test, etc.), we have decided to configure the SpringExtension to use ExtensionContextScope.TEST_METHOD by default. In addition, we have decided to provide a mechanism for users to switch back to the legacy "test-class scoped ExtensionContext" behavior in case third-party TestExecutionListener implementations are not yet compatible with test-method scoped ExtensionContext and TestContext semantics. This commit achieves the above goals as follows. - A new @SpringExtensionConfig annotation has been introduced, which allows developers to configure the effective ExtensionContext scope used by the SpringExtension. - The SpringExtension now overrides getTestInstantiationExtensionContextScope() to return ExtensionContextScope.TEST_METHOD. - The postProcessTestInstance() and resolveParameter() methods in the SpringExtension now find the properly scoped ExtensionContext for the supplied test class, based on whether the @Nested test class hierarchy is annotated with @SpringExtensionConfig(useTestClassScopedExtensionContext = true). See gh-35680 See gh-35716 Closes gh-35697
Spring Framework

This is the home of the Spring Framework: the foundation for all Spring projects. Collectively the Spring Framework and the family of Spring projects are often referred to simply as "Spring".
Spring provides everything required beyond the Java programming language for creating enterprise applications for a wide range of scenarios and architectures. Please read the Overview section of the reference documentation for a more complete introduction.
Code of Conduct
This project is governed by the Spring Code of Conduct. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to spring-code-of-conduct@spring.io.
Access to Binaries
For access to artifacts or a distribution zip, see the Spring Framework Artifacts wiki page.
Documentation
The Spring Framework maintains reference documentation (published and source), GitHub wiki pages, and an API reference. There are also guides and tutorials across Spring projects.
Micro-Benchmarks
See the Micro-Benchmarks wiki page.
Build from Source
See the Build from Source wiki page and the CONTRIBUTING.md file.
Continuous Integration Builds
Information regarding CI builds can be found in the Spring Framework Concourse pipeline documentation.
Stay in Touch
Follow @SpringCentral, @SpringFramework, and its team members on 𝕏. In-depth articles can be found at The Spring Blog, and releases are announced via our releases feed.
License
The Spring Framework is released under version 2.0 of the Apache License.