Skip to content

Commit 706c982

Browse files
committed
Emphasize @⁠Configuration classes over XML and Groovy in testing chapter
Closes gh-36393
1 parent b83cb4a commit 706c982

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

framework-docs/modules/ROOT/nav.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,9 @@
330330
*** xref:testing/testcontext-framework/application-events.adoc[]
331331
*** xref:testing/testcontext-framework/test-execution-events.adoc[]
332332
*** xref:testing/testcontext-framework/ctx-management.adoc[]
333+
**** xref:testing/testcontext-framework/ctx-management/javaconfig.adoc[]
333334
**** xref:testing/testcontext-framework/ctx-management/xml.adoc[]
334335
**** xref:testing/testcontext-framework/ctx-management/groovy.adoc[]
335-
**** xref:testing/testcontext-framework/ctx-management/javaconfig.adoc[]
336336
**** xref:testing/testcontext-framework/ctx-management/mixed-config.adoc[]
337337
**** xref:testing/testcontext-framework/ctx-management/context-customizers.adoc[]
338338
**** xref:testing/testcontext-framework/ctx-management/initializers.adoc[]

framework-docs/modules/ROOT/pages/testing/testcontext-framework/ctx-management.adoc

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ Kotlin::
4949
<1> Injecting the `ApplicationContext`.
5050
======
5151
52-
5352
Similarly, if your test is configured to load a `WebApplicationContext`, you can inject
5453
the web application context into your test, as follows:
5554
@@ -87,7 +86,6 @@ Kotlin::
8786
<2> Injecting the `WebApplicationContext`.
8887
======
8988
90-
9189
Dependency injection by using `@Autowired` is provided by the
9290
`DependencyInjectionTestExecutionListener`, which is configured by default
9391
(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
10098
locations or component classes, the configured `ContextLoader` determines how to load a
10199
context from a default location or default configuration classes. In addition to context
102100
resource locations and component classes, an application context can also be configured
103-
through application context initializers.
101+
through xref:testing/testcontext-framework/ctx-management/context-customizers.adoc[context customizers]
102+
or xref:testing/testcontext-framework/ctx-management/initializers.adoc[context initializers].
104103

105-
The following sections explain how to use Spring's `@ContextConfiguration` annotation to
106-
configure a test `ApplicationContext` by using XML configuration files, Groovy scripts,
107-
component classes (typically `@Configuration` classes), or context initializers.
108-
Alternatively, you can implement and configure your own custom `SmartContextLoader` for
109-
advanced use cases.
104+
The following sections explain how to use `@ContextConfiguration` and related annotations
105+
to configure a test `ApplicationContext` by using component classes (typically
106+
`@Configuration` classes), XML configuration files, Groovy scripts, context customizers,
107+
or context initializers. Alternatively, you can implement and configure your own custom
108+
`SmartContextLoader` for advanced use cases.
110109

110+
* xref:testing/testcontext-framework/ctx-management/javaconfig.adoc[Context Configuration with Component Classes]
111111
* xref:testing/testcontext-framework/ctx-management/xml.adoc[Context Configuration with XML resources]
112112
* xref:testing/testcontext-framework/ctx-management/groovy.adoc[Context Configuration with Groovy Scripts]
113-
* xref:testing/testcontext-framework/ctx-management/javaconfig.adoc[Context Configuration with Component Classes]
114113
* xref:testing/testcontext-framework/ctx-management/mixed-config.adoc[Mixing XML, Groovy Scripts, and Component Classes]
115114
* xref:testing/testcontext-framework/ctx-management/context-customizers.adoc[Context Configuration with Context Customizers]
116115
* xref:testing/testcontext-framework/ctx-management/initializers.adoc[Context Configuration with Context Initializers]

0 commit comments

Comments
 (0)