Skip to content

Support configuration of extension context scope for SpringExtension via Spring or JUnit properties #36460

Description

@ahrytsiuk

After upgrading to Spring Framework 7 we noticed tests failures when using @Nested annotation. Adding @SpringExtensionConfig(useTestClassScopedExtensionContext = true) fixes the problem.
I'm aware that this issue was discussed in multiple threads like #31456, #35880 and others.

However that task to add this annotation to fix tests on a big code base is a bit tedious.

Would it be possible to introduce a configuration parameter via spring.properties, similar to a new property in Spring 7.x spring.test.context.cache.pause? So we can configure this property globally without the need to modify many tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions