Skip to content

Add nested override coverage for SpringBootTest imports#50625

Merged
wilkinsona merged 1 commit into
spring-projects:4.0.xfrom
SJvaca30:test-nested-configuration-spring-boot
Jun 24, 2026
Merged

Add nested override coverage for SpringBootTest imports#50625
wilkinsona merged 1 commit into
spring-projects:4.0.xfrom
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 2 times, most recently from 7068877 to 629f9ff Compare May 30, 2026 18:04
@wilkinsona wilkinsona added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 24, 2026
@wilkinsona wilkinsona added this to the 4.0.x milestone Jun 24, 2026
@wilkinsona wilkinsona self-assigned this Jun 24, 2026
@wilkinsona wilkinsona force-pushed the test-nested-configuration-spring-boot branch from 629f9ff to 34ce653 Compare June 24, 2026 18:49
@wilkinsona wilkinsona changed the base branch from main to 4.0.x June 24, 2026 18:49
@wilkinsona wilkinsona modified the milestones: 4.0.x, 4.0.8 Jun 24, 2026
@wilkinsona wilkinsona merged commit 58cb433 into spring-projects:4.0.x Jun 24, 2026
4 checks passed
@wilkinsona

Copy link
Copy Markdown
Member

Thank you, @SJvaca30.

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

Labels

type: task A general task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants