Skip to content

Log warning when default context configuration is ignored within test class hierarchies #36390

@sbrannen

Description

@sbrannen

Overview

In Spring Framework 7.1, the TestContext Framework will reliably detect all implicit default context configuration within the type hierarchy or enclosing class hierarchy (for @Nested test classes) above a given test class.

However, test suites may encounter failures once we make that switch in behavior (see #31456 (comment)).

In order to help development teams prepare for the switch in 7.1, we should log a warning whenever we detect default context configuration that is currently ignored.

We should be able to use the new
resolveDefaultContextConfigurationAttributes() method that was introduced in
ContextLoaderUtils in commit 4ae471d to perform such detection.

Related Issues

Metadata

Metadata

Assignees

Labels

for: upgrade-attentionAn issue requiring extra attention when upgradingin: testIssues in the test moduletype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions