From c77993acaca398ea7601ca1e476743337b1c98f2 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Wed, 25 Feb 2026 15:26:32 +0100 Subject: [PATCH] =?UTF-8?q?Emphasize=20@=E2=81=A0Configuration=20classes?= =?UTF-8?q?=20over=20XML=20and=20Groovy=20in=20testing=20chapter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes gh-36393 (cherry picked from commit 706c98228d10db2bbc2f8cbd134eb81e15d885f9) --- framework-docs/modules/ROOT/nav.adoc | 2 +- .../testcontext-framework/ctx-management.adoc | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/framework-docs/modules/ROOT/nav.adoc b/framework-docs/modules/ROOT/nav.adoc index da2650dcec0..10d6612e615 100644 --- a/framework-docs/modules/ROOT/nav.adoc +++ b/framework-docs/modules/ROOT/nav.adoc @@ -326,9 +326,9 @@ *** xref:testing/testcontext-framework/application-events.adoc[] *** xref:testing/testcontext-framework/test-execution-events.adoc[] *** xref:testing/testcontext-framework/ctx-management.adoc[] +**** xref:testing/testcontext-framework/ctx-management/javaconfig.adoc[] **** xref:testing/testcontext-framework/ctx-management/xml.adoc[] **** xref:testing/testcontext-framework/ctx-management/groovy.adoc[] -**** xref:testing/testcontext-framework/ctx-management/javaconfig.adoc[] **** xref:testing/testcontext-framework/ctx-management/mixed-config.adoc[] **** xref:testing/testcontext-framework/ctx-management/context-customizers.adoc[] **** xref:testing/testcontext-framework/ctx-management/initializers.adoc[] diff --git a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/ctx-management.adoc b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/ctx-management.adoc index 393c30a8a19..1ef02f8dd2b 100644 --- a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/ctx-management.adoc +++ b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/ctx-management.adoc @@ -49,7 +49,6 @@ Kotlin:: <1> Injecting the `ApplicationContext`. ====== - Similarly, if your test is configured to load a `WebApplicationContext`, you can inject the web application context into your test, as follows: @@ -87,7 +86,6 @@ Kotlin:: <2> Injecting the `WebApplicationContext`. ====== - Dependency injection by using `@Autowired` is provided by the `DependencyInjectionTestExecutionListener`, which is configured by default (see xref:testing/testcontext-framework/fixture-di.adoc[Dependency Injection of Test Fixtures]). @@ -100,17 +98,18 @@ class level. If your test class does not explicitly declare application context locations or component classes, the configured `ContextLoader` determines how to load a context from a default location or default configuration classes. In addition to context resource locations and component classes, an application context can also be configured -through application context initializers. +through xref:testing/testcontext-framework/ctx-management/context-customizers.adoc[context customizers] +or xref:testing/testcontext-framework/ctx-management/initializers.adoc[context initializers]. -The following sections explain how to use Spring's `@ContextConfiguration` annotation to -configure a test `ApplicationContext` by using XML configuration files, Groovy scripts, -component classes (typically `@Configuration` classes), or context initializers. -Alternatively, you can implement and configure your own custom `SmartContextLoader` for -advanced use cases. +The following sections explain how to use `@ContextConfiguration` and related annotations +to configure a test `ApplicationContext` by using component classes (typically +`@Configuration` classes), XML configuration files, Groovy scripts, context customizers, +or context initializers. Alternatively, you can implement and configure your own custom +`SmartContextLoader` for advanced use cases. +* xref:testing/testcontext-framework/ctx-management/javaconfig.adoc[Context Configuration with Component Classes] * xref:testing/testcontext-framework/ctx-management/xml.adoc[Context Configuration with XML resources] * xref:testing/testcontext-framework/ctx-management/groovy.adoc[Context Configuration with Groovy Scripts] -* xref:testing/testcontext-framework/ctx-management/javaconfig.adoc[Context Configuration with Component Classes] * xref:testing/testcontext-framework/ctx-management/mixed-config.adoc[Mixing XML, Groovy Scripts, and Component Classes] * xref:testing/testcontext-framework/ctx-management/context-customizers.adoc[Context Configuration with Context Customizers] * xref:testing/testcontext-framework/ctx-management/initializers.adoc[Context Configuration with Context Initializers]