Skip to content

Commit df4868b

Browse files
committed
Merge branch '6.2.x'
2 parents 1795b23 + cd987fc commit df4868b

File tree

35 files changed

+112
-145
lines changed

35 files changed

+112
-145
lines changed

Diff for: framework-docs/modules/ROOT/pages/testing/testcontext-framework/ctx-management/caching.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Once the TestContext framework loads an `ApplicationContext` (or `WebApplicationContext`)
55
for a test, that context is cached and reused for all subsequent tests that declare the
66
same unique context configuration within the same test suite. To understand how caching
7-
works, it is important to understand what is meant by "`unique`" and "`test suite.`"
7+
works, it is important to understand what is meant by "unique" and "test suite."
88

99
An `ApplicationContext` can be uniquely identified by the combination of configuration
1010
parameters that is used to load it. Consequently, the unique combination of configuration
@@ -15,8 +15,8 @@ framework uses the following configuration parameters to build the context cache
1515
* `classes` (from `@ContextConfiguration`)
1616
* `contextInitializerClasses` (from `@ContextConfiguration`)
1717
* `contextCustomizers` (from `ContextCustomizerFactory`) – this includes
18-
`@DynamicPropertySource` methods as well as various features from Spring Boot's
19-
testing support such as `@MockBean` and `@SpyBean`.
18+
`@DynamicPropertySource` methods, bean overrides (such as `@TestBean`, `@MockitoBean`,
19+
`@MockitoSpyBean` etc.), as well as various features from Spring Boot's testing support.
2020
* `contextLoader` (from `@ContextConfiguration`)
2121
* `parent` (from `@ContextHierarchy`)
2222
* `activeProfiles` (from `@ActiveProfiles`)

Diff for: framework-docs/modules/ROOT/pages/testing/testcontext-framework/parallel-test-execution.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Do not run tests in parallel if the tests:
1818
* Use Spring Framework's `@DirtiesContext` support.
1919
* Use Spring Framework's `@MockitoBean` or `@MockitoSpyBean` support.
2020
* Use Spring Boot's `@MockBean` or `@SpyBean` support.
21-
* Use JUnit 4's `@FixMethodOrder` support or any testing framework feature
22-
that is designed to ensure that test methods run in a particular order. Note,
23-
however, that this does not apply if entire test classes are run in parallel.
21+
* Use JUnit Jupiter's `@TestMethodOrder` support or any testing framework feature that is
22+
designed to ensure that test methods run in a particular order. Note, however, that
23+
this does not apply if entire test classes are run in parallel.
2424
* Change the state of shared services or systems such as a database, message broker,
2525
filesystem, and others. This applies to both embedded and external systems.
2626

Diff for: spring-core/src/main/java/org/springframework/core/io/DefaultResourceLoader.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -59,7 +59,7 @@ public class DefaultResourceLoader implements ResourceLoader {
5959
/**
6060
* Create a new DefaultResourceLoader.
6161
* <p>ClassLoader access will happen using the thread context class loader
62-
* at the time of actual resource access (since 5.3). For more control, pass
62+
* at the time of actual resource access. For more control, pass
6363
* a specific ClassLoader to {@link #DefaultResourceLoader(ClassLoader)}.
6464
* @see java.lang.Thread#getContextClassLoader()
6565
*/
@@ -80,7 +80,7 @@ public DefaultResourceLoader(@Nullable ClassLoader classLoader) {
8080
* Specify the ClassLoader to load class path resources with, or {@code null}
8181
* for using the thread context class loader at the time of actual resource access.
8282
* <p>The default is that ClassLoader access will happen using the thread context
83-
* class loader at the time of actual resource access (since 5.3).
83+
* class loader at the time of actual resource access.
8484
*/
8585
public void setClassLoader(@Nullable ClassLoader classLoader) {
8686
this.classLoader = classLoader;

Diff for: spring-core/src/main/java/org/springframework/core/io/support/SpringFactoriesLoader.java

+18-24
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,12 @@ protected SpringFactoriesLoader(@Nullable ClassLoader classLoader, Map<String, L
125125
* Load and instantiate the factory implementations of the given type from
126126
* {@value #FACTORIES_RESOURCE_LOCATION}, using the configured class loader
127127
* and a default argument resolver that expects a no-arg constructor.
128-
* <p>The returned factories are sorted through {@link AnnotationAwareOrderComparator}.
128+
* <p>The returned factories are sorted using {@link AnnotationAwareOrderComparator}.
129129
* <p>If a custom instantiation strategy is required, use {@code load(...)}
130130
* with a custom {@link ArgumentResolver ArgumentResolver} and/or
131131
* {@link FailureHandler FailureHandler}.
132-
* <p>As of Spring Framework 5.3, if duplicate implementation class names are
133-
* discovered for a given factory type, only one instance of the duplicated
134-
* implementation type will be instantiated.
132+
* <p>If duplicate implementation class names are discovered for a given factory
133+
* type, only one instance of the duplicated implementation type will be instantiated.
135134
* @param factoryType the interface or abstract class representing the factory
136135
* @throws IllegalArgumentException if any factory implementation class cannot
137136
* be loaded or if an error occurs while instantiating any factory
@@ -145,10 +144,9 @@ public <T> List<T> load(Class<T> factoryType) {
145144
* Load and instantiate the factory implementations of the given type from
146145
* {@value #FACTORIES_RESOURCE_LOCATION}, using the configured class loader
147146
* and the given argument resolver.
148-
* <p>The returned factories are sorted through {@link AnnotationAwareOrderComparator}.
149-
* <p>As of Spring Framework 5.3, if duplicate implementation class names are
150-
* discovered for a given factory type, only one instance of the duplicated
151-
* implementation type will be instantiated.
147+
* <p>The returned factories are sorted using {@link AnnotationAwareOrderComparator}.
148+
* <p>If duplicate implementation class names are discovered for a given factory
149+
* type, only one instance of the duplicated implementation type will be instantiated.
152150
* @param factoryType the interface or abstract class representing the factory
153151
* @param argumentResolver strategy used to resolve constructor arguments by their type
154152
* @throws IllegalArgumentException if any factory implementation class cannot
@@ -163,10 +161,9 @@ public <T> List<T> load(Class<T> factoryType, @Nullable ArgumentResolver argumen
163161
* Load and instantiate the factory implementations of the given type from
164162
* {@value #FACTORIES_RESOURCE_LOCATION}, using the configured class loader
165163
* with custom failure handling provided by the given failure handler.
166-
* <p>The returned factories are sorted through {@link AnnotationAwareOrderComparator}.
167-
* <p>As of Spring Framework 5.3, if duplicate implementation class names are
168-
* discovered for a given factory type, only one instance of the duplicated
169-
* implementation type will be instantiated.
164+
* <p>The returned factories are sorted using {@link AnnotationAwareOrderComparator}.
165+
* <p>If duplicate implementation class names are discovered for a given factory
166+
* type, only one instance of the duplicated implementation type will be instantiated.
170167
* <p>For any factory implementation class that cannot be loaded or error that
171168
* occurs while instantiating it, the given failure handler is called.
172169
* @param factoryType the interface or abstract class representing the factory
@@ -182,10 +179,9 @@ public <T> List<T> load(Class<T> factoryType, @Nullable FailureHandler failureHa
182179
* {@value #FACTORIES_RESOURCE_LOCATION}, using the configured class loader,
183180
* the given argument resolver, and custom failure handling provided by the given
184181
* failure handler.
185-
* <p>The returned factories are sorted through {@link AnnotationAwareOrderComparator}.
186-
* <p>As of Spring Framework 5.3, if duplicate implementation class names are
187-
* discovered for a given factory type, only one instance of the duplicated
188-
* implementation type will be instantiated.
182+
* <p>The returned factories are sorted using {@link AnnotationAwareOrderComparator}.
183+
* <p>If duplicate implementation class names are discovered for a given factory
184+
* type, only one instance of the duplicated implementation type will be instantiated.
189185
* <p>For any factory implementation class that cannot be loaded or error that
190186
* occurs while instantiating it, the given failure handler is called.
191187
* @param factoryType the interface or abstract class representing the factory
@@ -235,12 +231,11 @@ private List<String> loadFactoryNames(Class<?> factoryType) {
235231
/**
236232
* Load and instantiate the factory implementations of the given type from
237233
* {@value #FACTORIES_RESOURCE_LOCATION}, using the given class loader.
238-
* <p>The returned factories are sorted through {@link AnnotationAwareOrderComparator}.
239-
* <p>As of Spring Framework 5.3, if duplicate implementation class names are
240-
* discovered for a given factory type, only one instance of the duplicated
241-
* implementation type will be instantiated.
234+
* <p>The returned factories are sorted using {@link AnnotationAwareOrderComparator}.
235+
* <p>If duplicate implementation class names are discovered for a given factory
236+
* type, only one instance of the duplicated implementation type will be instantiated.
242237
* <p>For more advanced factory loading with {@link ArgumentResolver} or
243-
* {@link FailureHandler} support use {@link #forDefaultResourceLocation(ClassLoader)}
238+
* {@link FailureHandler} support, use {@link #forDefaultResourceLocation(ClassLoader)}
244239
* to obtain a {@link SpringFactoriesLoader} instance.
245240
* @param factoryType the interface or abstract class representing the factory
246241
* @param classLoader the ClassLoader to use for loading (can be {@code null}
@@ -256,9 +251,8 @@ public static <T> List<T> loadFactories(Class<T> factoryType, @Nullable ClassLoa
256251
* Load the fully qualified class names of factory implementations of the
257252
* given type from {@value #FACTORIES_RESOURCE_LOCATION}, using the given
258253
* class loader.
259-
* <p>As of Spring Framework 5.3, if a particular implementation class name
260-
* is discovered more than once for the given factory type, duplicates will
261-
* be ignored.
254+
* <p>If a particular implementation class name is discovered more than once
255+
* for the given factory type, duplicates will be ignored.
262256
* @param factoryType the interface or abstract class representing the factory
263257
* @param classLoader the ClassLoader to use for loading resources; can be
264258
* {@code null} to use the default

Diff for: spring-core/src/main/java/org/springframework/util/CollectionUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public static <K, V> HashMap<K, V> newHashMap(int expectedSize) {
103103
* <p>This differs from the regular {@link LinkedHashMap} constructor
104104
* which takes an initial capacity relative to a load factor but is
105105
* aligned with Spring's own {@link LinkedCaseInsensitiveMap} and
106-
* {@link LinkedMultiValueMap} constructor semantics as of 5.3.
106+
* {@link LinkedMultiValueMap} constructor semantics.
107107
* @param expectedSize the expected number of elements (with a corresponding
108108
* capacity to be derived so that no resize/rehash operations are needed)
109109
* @since 5.3

Diff for: spring-core/src/main/java/org/springframework/util/LinkedMultiValueMap.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -35,8 +35,7 @@
3535
* @param <K> the key type
3636
* @param <V> the value element type
3737
*/
38-
public class LinkedMultiValueMap<K, V> extends MultiValueMapAdapter<K, V> // new public base class in 5.3
39-
implements Serializable, Cloneable {
38+
public class LinkedMultiValueMap<K, V> extends MultiValueMapAdapter<K, V> implements Serializable, Cloneable {
4039

4140
private static final long serialVersionUID = 3801124242820219131L;
4241

Diff for: spring-test/src/main/java/org/springframework/test/annotation/Commit.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -44,8 +44,7 @@
4444
* {@code @Commit} and {@code @Rollback} on the same test method or on the
4545
* same test class is unsupported and may lead to unpredictable results.
4646
*
47-
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
48-
* enclosing test class by default. See
47+
* <p>This annotation will be inherited from an enclosing test class by default. See
4948
* {@link org.springframework.test.context.NestedTestConfiguration @NestedTestConfiguration}
5049
* for details.
5150
*

Diff for: spring-test/src/main/java/org/springframework/test/annotation/DirtiesContext.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -76,8 +76,7 @@
7676
* <p>This annotation may be used as a <em>meta-annotation</em> to create custom
7777
* <em>composed annotations</em>.
7878
*
79-
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
80-
* enclosing test class by default. See
79+
* <p>This annotation will be inherited from an enclosing test class by default. See
8180
* {@link org.springframework.test.context.NestedTestConfiguration @NestedTestConfiguration}
8281
* for details.
8382
*

Diff for: spring-test/src/main/java/org/springframework/test/annotation/Rollback.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -48,8 +48,7 @@
4848
* custom <em>composed annotations</em>. Consult the source code for
4949
* {@link Commit @Commit} for a concrete example.
5050
*
51-
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
52-
* enclosing test class by default. See
51+
* <p>This annotation will be inherited from an enclosing test class by default. See
5352
* {@link org.springframework.test.context.NestedTestConfiguration @NestedTestConfiguration}
5453
* for details.
5554
*

Diff for: spring-test/src/main/java/org/springframework/test/context/ActiveProfiles.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,9 +34,8 @@
3434
* <p>This annotation may be used as a <em>meta-annotation</em> to create custom
3535
* <em>composed annotations</em>.
3636
*
37-
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
38-
* enclosing test class by default. See
39-
* {@link NestedTestConfiguration @NestedTestConfiguration} for details.
37+
* <p>This annotation will be inherited from an enclosing test class by default.
38+
* See {@link NestedTestConfiguration @NestedTestConfiguration} for details.
4039
*
4140
* @author Sam Brannen
4241
* @since 3.1

Diff for: spring-test/src/main/java/org/springframework/test/context/BootstrapWith.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@
3434
* present</em> on the current test class) will override any meta-present
3535
* declarations of {@code @BootstrapWith}.
3636
*
37-
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
38-
* enclosing test class by default. See
39-
* {@link NestedTestConfiguration @NestedTestConfiguration} for details.
37+
* <p>This annotation will be inherited from an enclosing test class by default.
38+
* See {@link NestedTestConfiguration @NestedTestConfiguration} for details.
4039
*
4140
* @author Sam Brannen
4241
* @since 4.1

Diff for: spring-test/src/main/java/org/springframework/test/context/ContextConfiguration.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,8 @@
7575
* <p>This annotation may be used as a <em>meta-annotation</em> to create custom
7676
* <em>composed annotations</em>.
7777
*
78-
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
79-
* enclosing test class by default. See
80-
* {@link NestedTestConfiguration @NestedTestConfiguration} for details.
78+
* <p>This annotation will be inherited from an enclosing test class by default.
79+
* See {@link NestedTestConfiguration @NestedTestConfiguration} for details.
8180
*
8281
* @author Sam Brannen
8382
* @since 2.5

Diff for: spring-test/src/main/java/org/springframework/test/context/ContextHierarchy.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,8 @@
205205
* <p>This annotation may be used as a <em>meta-annotation</em> to create custom
206206
* <em>composed annotations</em>.
207207
*
208-
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
209-
* enclosing test class by default. See
210-
* {@link NestedTestConfiguration @NestedTestConfiguration} for details.
208+
* <p>This annotation will be inherited from an enclosing test class by default.
209+
* See {@link NestedTestConfiguration @NestedTestConfiguration} for details.
211210
*
212211
* @author Sam Brannen
213212
* @since 3.2.2

Diff for: spring-test/src/main/java/org/springframework/test/context/TestConstructor.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -53,9 +53,8 @@
5353
* {@link org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig @SpringJUnitWebConfig}
5454
* or various test-related annotations from Spring Boot Test.
5555
*
56-
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
57-
* enclosing test class by default. See
58-
* {@link NestedTestConfiguration @NestedTestConfiguration} for details.
56+
* <p>This annotation will be inherited from an enclosing test class by default.
57+
* See {@link NestedTestConfiguration @NestedTestConfiguration} for details.
5958
*
6059
* @author Sam Brannen
6160
* @since 5.2
@@ -88,7 +87,7 @@
8887
* <p>May alternatively be configured via the
8988
* {@link org.springframework.core.SpringProperties SpringProperties}
9089
* mechanism.
91-
* <p>As of Spring Framework 5.3, this property may also be configured as a
90+
* <p>This property may also be configured as a
9291
* <a href="https://junit.org/junit5/docs/current/user-guide/#running-tests-config-params">JUnit
9392
* Platform configuration parameter</a>.
9493
* @see #autowireMode

Diff for: spring-test/src/main/java/org/springframework/test/context/TestExecutionListeners.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,8 +36,8 @@
3636
* mechanism described in {@link TestExecutionListener}.
3737
*
3838
* <p>This annotation may be used as a <em>meta-annotation</em> to create custom
39-
* <em>composed annotations</em>. As of Spring Framework 5.3, this annotation will
40-
* be inherited from an enclosing test class by default. See
39+
* <em>composed annotations</em>. In addition, this annotation will be inherited
40+
* from an enclosing test class by default. See
4141
* {@link NestedTestConfiguration @NestedTestConfiguration} for details.
4242
*
4343
* <h3>Switching to default {@code TestExecutionListener} implementations</h3>

Diff for: spring-test/src/main/java/org/springframework/test/context/TestPropertySource.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -80,9 +80,8 @@
8080
* of both annotations can lead to ambiguity during the attribute resolution
8181
* process. Note, however, that ambiguity can be avoided via explicit annotation
8282
* attribute overrides using {@link AliasFor @AliasFor}.</li>
83-
* <li>As of Spring Framework 5.3, this annotation will be inherited from an
84-
* enclosing test class by default. See
85-
* {@link NestedTestConfiguration @NestedTestConfiguration} for details.</li>
83+
* <li>This annotation will be inherited from an enclosing test class by default.
84+
* See {@link NestedTestConfiguration @NestedTestConfiguration} for details.</li>
8685
* </ul>
8786
*
8887
* @author Sam Brannen

Diff for: spring-test/src/main/java/org/springframework/test/context/TestPropertySources.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,9 +31,8 @@
3131
* completely optional since {@code @TestPropertySource} is a
3232
* {@linkplain java.lang.annotation.Repeatable repeatable} annotation.
3333
*
34-
* <p>As of Spring Framework 5.3, this annotation will be inherited from an
35-
* enclosing test class by default. See
36-
* {@link NestedTestConfiguration @NestedTestConfiguration} for details.
34+
* <p>This annotation will be inherited from an enclosing test class by default.
35+
* See {@link NestedTestConfiguration @NestedTestConfiguration} for details.
3736
*
3837
* @author Anatoliy Korovin
3938
* @author Sam Brannen

0 commit comments

Comments
 (0)