You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use test-method scoped ExtensionContext in the SpringExtension #35697
As of Spring Framework 6.2.13 (see #35680), we support JUnit Jupiter's ExtensionContextScope.TEST_METHOD behavior in the SpringExtension and the BeanOverrideTestExecutionListener; however, users can only benefit from that if they explicitly set the junit.jupiter.extensions.testinstantiation.extensioncontextscope.default configuration parameter to test_method for their entire test suite, which may have adverse effects on third-party JUnit Jupiter extensions.
For Spring Framework 7.0, in order to support common @Autowired injection scenarios in @Nested test class hierarchies by default, we should configure the SpringExtension to use ExtensionContextScope.TEST_METHOD, and we should provide a mechanism for users to switch back to the legacy "test-class scoped ExtensionContext" behavior — for example, via a type-level annotation that can be applied to a given @Nested test class hierarchy.
changed the title [-]Use `TEST_METHOD` `ExtensionContextScope` in `SpringExtension` by default[/-][+]Use test-method scoped `ExtensionContext` in the `SpringExtension`[/+]on Oct 30, 2025
Activity
sbrannen commentedon Oct 28, 2025
[-]Use `TEST_METHOD` `ExtensionContextScope` in `SpringExtension` by default[/-][+]Use test-method scoped `ExtensionContext` in the `SpringExtension`[/+]Use test-method scoped ExtensionContext in the SpringExtension
Fix Javadoc links
Support global ExtensionContext scope configuration for SpringExtension