Skip to content

Add nested override coverage for SpringBootTest imports#50625

Open
SJvaca30 wants to merge 1 commit into
spring-projects:mainfrom
SJvaca30:test-nested-configuration-spring-boot
Open

Add nested override coverage for SpringBootTest imports#50625
SJvaca30 wants to merge 1 commit into
spring-projects:mainfrom
SJvaca30:test-nested-configuration-spring-boot

Conversation

@SJvaca30
Copy link
Copy Markdown
Contributor

This adds @NestedTestConfiguration(OVERRIDE) coverage to SpringBootTestImportTests.

The existing nested tests verify the default inherited behavior where the enclosing class's @Import and @TestPropertySource are honored by a nested @SpringBootTest. The new nested test class verifies the contrasting override behavior: the nested class keeps its own @Import, but no longer inherits the enclosing class's import or test property source.

See gh-23929.

Validation:

  • ./gradlew :core:spring-boot-test:test --tests org.springframework.boot.test.context.SpringBootTestImportTests --rerun-tasks --no-daemon
  • ./gradlew :core:spring-boot-test:checkFormatTest :core:spring-boot-test:checkstyleTest --no-daemon
  • git diff --check

Additional check:

  • Temporarily removing @NestedTestConfiguration(EnclosingConfiguration.OVERRIDE) made the new override assertions fail, confirming the test covers the intended behavior.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 29, 2026
@SJvaca30 SJvaca30 force-pushed the test-nested-configuration-spring-boot branch from ff3cc47 to 7068877 Compare May 29, 2026 15:41
Signed-off-by: SJLIM <yyvaca30@gmail.com>
@SJvaca30 SJvaca30 force-pushed the test-nested-configuration-spring-boot branch from 7068877 to 629f9ff Compare May 30, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants