Skip to content

Add test for nested @Import handling in SpringBootTest#49887

Closed
Gautam-aman wants to merge 1 commit intospring-projects:mainfrom
Gautam-aman:fix-nested-import-test
Closed

Add test for nested @Import handling in SpringBootTest#49887
Gautam-aman wants to merge 1 commit intospring-projects:mainfrom
Gautam-aman:fix-nested-import-test

Conversation

@Gautam-aman
Copy link
Copy Markdown

@Gautam-aman Gautam-aman commented Apr 4, 2026

Fixes #49860

This PR adds a test that demonstrates that @Import annotations
declared on an enclosing test class are not applied to nested
test classes.

Currently, nested test classes override configuration instead of
merging with enclosing classes, causing outer @Import to be ignored.

This test highlights the issue and can serve as a basis for further
discussion or fixes.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 4, 2026
Signed-off-by: Aman Gautam <amangautam2128@gmail.com>
@Gautam-aman Gautam-aman force-pushed the fix-nested-import-test branch from a386265 to 5e2cf0c Compare April 4, 2026 05:39
@philwebb
Copy link
Copy Markdown
Member

philwebb commented Apr 4, 2026

Thanks, but issue #49860 is already assigned so we won't be accepting pull-requests in this area.

@philwebb philwebb closed this Apr 4, 2026
@philwebb philwebb added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: declined A suggestion or change that we don't feel we should currently apply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Imports on a containing test class are ignored when a nested class has imports

3 participants