Skip to content

GH-28632: Add @NestedTestConfiguration(OVERRIDE) example to docs#36898

Open
won-seoop wants to merge 2 commits into
spring-projects:mainfrom
won-seoop:gh-28632-nested-test-configuration-example
Open

GH-28632: Add @NestedTestConfiguration(OVERRIDE) example to docs#36898
won-seoop wants to merge 2 commits into
spring-projects:mainfrom
won-seoop:gh-28632-nested-test-configuration-example

Conversation

@won-seoop

@won-seoop won-seoop commented Jun 10, 2026

Copy link
Copy Markdown

Summary

Adds a Java and Kotlin code example to the @Nested test class configuration section of the reference manual (support-classes.adoc) demonstrating @NestedTestConfiguration(EnclosingConfiguration.OVERRIDE).

The existing example only shows the default INHERIT behavior (configuration inherited from the enclosing class). The new example shows the complementary OVERRIDE case: a @Nested class that opts out of inheriting from its enclosing class and declares its own @SpringJUnitConfig instead.

The example follows the same "Hello World" GreetingServiceTests context established in the section, adding a SpecialCaseTests inner class to illustrate the use of OVERRIDE.

Also adds a note that EnclosingConfiguration is statically imported from NestedTestConfiguration.EnclosingConfiguration.

Related issues

🤖 Generated with Claude Code

won-seoop and others added 2 commits June 10, 2026 10:15
…th examples

Expand the "Transaction management for @SQL" section in the reference
manual to explain the practical difference between INFERRED and ISOLATED
transaction modes:

- Split the section into dedicated subsections for each mode
- Document INFERRED behavior: participates in the active test transaction,
  so script changes roll back together with the test method
- Document when to use ISOLATED: when committed data must be visible to
  code that opens its own transaction, along with a cleanup pattern using
  AFTER_TEST_METHOD

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…le to docs

Add a Java and Kotlin code example demonstrating how to use
@NestedTestConfiguration(EnclosingConfiguration.OVERRIDE) to opt a
specific @nested test class out of inheriting Spring configuration from
its enclosing class, and supply a dedicated @SpringJUnitConfig instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 10, 2026
@sbrannen sbrannen added in: test Issues in the test module type: documentation A documentation task status: waiting-for-feedback We need additional information before we can continue labels Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: test Issues in the test module status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on type: documentation A documentation task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants