Skip to content

Commit 09086fc

Browse files
committed
Revise TestExecutionListener order values documentation
See gh-34265
1 parent 128e900 commit 09086fc

12 files changed

+40
-33
lines changed

Diff for: spring-test/src/main/java/org/springframework/test/context/bean/override/BeanOverrideTestExecutionListener.java

+2-2
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.
@@ -40,7 +40,7 @@ public class BeanOverrideTestExecutionListener extends AbstractTestExecutionList
4040
* Returns {@code 1950}, which ensures that the {@code BeanOverrideTestExecutionListener}
4141
* is ordered after the
4242
* {@link org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener
43-
* DirtiesContextBeforeModesTestExecutionListener} and just before the
43+
* DirtiesContextBeforeModesTestExecutionListener} and before the
4444
* {@link DependencyInjectionTestExecutionListener}.
4545
*/
4646
@Override

Diff for: spring-test/src/main/java/org/springframework/test/context/bean/override/mockito/MockitoResetTestExecutionListener.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ public class MockitoResetTestExecutionListener extends AbstractTestExecutionList
7474

7575

7676
/**
77-
* Returns {@code Ordered.LOWEST_PRECEDENCE - 100}.
77+
* Returns {@code Ordered.LOWEST_PRECEDENCE - 100}, which ensures that the
78+
* {@code MockitoResetTestExecutionListener} is ordered after all standard
79+
* {@code TestExecutionListener} implementations.
7880
*/
7981
@Override
8082
public int getOrder() {

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

+5-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.
@@ -64,9 +64,11 @@ public class ApplicationEventsTestExecutionListener extends AbstractTestExecutio
6464
* Returns {@code 1800}, which ensures that the {@code ApplicationEventsTestExecutionListener}
6565
* is ordered after the
6666
* {@link org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener
67-
* DirtiesContextBeforeModesTestExecutionListener} and just before the
67+
* DirtiesContextBeforeModesTestExecutionListener} and before the
6868
* {@link org.springframework.test.context.bean.override.BeanOverrideTestExecutionListener
69-
* BeanOverrideTestExecutionListener}.
69+
* BeanOverrideTestExecutionListener} and the
70+
* {@link org.springframework.test.context.support.DependencyInjectionTestExecutionListener
71+
* DependencyInjectionTestExecutionListener}.
7072
*/
7173
@Override
7274
public final int getOrder() {

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

+4-2
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.
@@ -101,7 +101,9 @@ public class EventPublishingTestExecutionListener extends AbstractTestExecutionL
101101
* Returns {@code 10000}, which ensures that the {@code EventPublishingTestExecutionListener}
102102
* is ordered after the
103103
* {@link org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener
104-
* SqlScriptsTestExecutionListener}.
104+
* SqlScriptsTestExecutionListener} and before the
105+
* {@link org.springframework.test.context.bean.override.mockito.MockitoResetTestExecutionListener
106+
* MockitoResetTestExecutionListener}.
105107
*/
106108
@Override
107109
public final int getOrder() {

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

+2-2
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.
@@ -129,7 +129,7 @@ public class SqlScriptsTestExecutionListener extends AbstractTestExecutionListen
129129
* Returns {@code 5000}, which ensures that the {@code SqlScriptsTestExecutionListener}
130130
* is ordered after the
131131
* {@link org.springframework.test.context.transaction.TransactionalTestExecutionListener
132-
* TransactionalTestExecutionListener} and just before the
132+
* TransactionalTestExecutionListener} and before the
133133
* {@link org.springframework.test.context.event.EventPublishingTestExecutionListener
134134
* EventPublishingTestExecutionListener}.
135135
*/

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

+4-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.
@@ -107,10 +107,10 @@ public MicrometerObservationRegistryTestExecutionListener() {
107107

108108

109109
/**
110-
* Returns {@code 2500}, which ensures that the {@code MicrometerObservationRegistryTestExecutionListener}
111-
* is ordered after the
110+
* Returns {@code 2500}, which ensures that the
111+
* {@code MicrometerObservationRegistryTestExecutionListener} is ordered after the
112112
* {@link org.springframework.test.context.support.DependencyInjectionTestExecutionListener
113-
* DependencyInjectionTestExecutionListener} and just before the
113+
* DependencyInjectionTestExecutionListener} and before the
114114
* {@link org.springframework.test.context.support.DirtiesContextTestExecutionListener
115115
* DirtiesContextTestExecutionListener}.
116116
*/

Diff for: spring-test/src/main/java/org/springframework/test/context/support/CommonCachesTestExecutionListener.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.
@@ -38,8 +38,7 @@ public class CommonCachesTestExecutionListener extends AbstractTestExecutionList
3838
/**
3939
* Returns {@code 3005}, which ensures that the {@code CommonCachesTestExecutionListener}
4040
* is ordered after the
41-
* {@link org.springframework.test.context.support.DirtiesContextTestExecutionListener
42-
* DirtiesContextTestExecutionListener} and just before the
41+
* {@link DirtiesContextTestExecutionListener DirtiesContextTestExecutionListener} and before the
4342
* {@link org.springframework.test.context.transaction.TransactionalTestExecutionListener
4443
* TransactionalTestExecutionListener}.
4544
*/

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

+8-6
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.
@@ -63,12 +63,14 @@ public class DependencyInjectionTestExecutionListener extends AbstractTestExecut
6363

6464

6565
/**
66-
* Returns {@code 2000}, which ensures that the {@code ApplicationEventsTestExecutionListener}
66+
* Returns {@code 2000}, which ensures that the {@code DependencyInjectionTestExecutionListener}
6767
* is ordered after the
68-
* {@link org.springframework.test.context.bean.override.BeanOverrideTestExecutionListener
69-
* BeanOverrideTestExecutionListener} and just before the
70-
* {@link org.springframework.test.context.support.DirtiesContextTestExecutionListener
71-
* DirtiesContextTestExecutionListener}.
68+
* {@link DirtiesContextBeforeModesTestExecutionListener DirtiesContextBeforeModesTestExecutionListener}
69+
* and the {@link org.springframework.test.context.bean.override.BeanOverrideTestExecutionListener
70+
* BeanOverrideTestExecutionListener} and before the
71+
* {@link org.springframework.test.context.observation.MicrometerObservationRegistryTestExecutionListener
72+
* MicrometerObservationRegistryTestExecutionListener} and the
73+
* {@link DirtiesContextTestExecutionListener DirtiesContextTestExecutionListener}.
7274
*/
7375
@Override
7476
public final int getOrder() {

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 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.
@@ -58,7 +58,9 @@ public class DirtiesContextBeforeModesTestExecutionListener extends AbstractDirt
5858
* Returns {@code 1500}, which ensures that the {@code DirtiesContextBeforeModesTestExecutionListener}
5959
* is ordered after the
6060
* {@link org.springframework.test.context.web.ServletTestExecutionListener
61-
* ServletTestExecutionListener} and just before the
61+
* ServletTestExecutionListener} and before the
62+
* {@link org.springframework.test.context.event.ApplicationEventsTestExecutionListener
63+
* ApplicationEventsTestExecutionListener} and the
6264
* {@link org.springframework.test.context.bean.override.BeanOverrideTestExecutionListener
6365
* BeanOverrideTestExecutionListener}.
6466
*/

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

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 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.
@@ -57,10 +57,8 @@ public class DirtiesContextTestExecutionListener extends AbstractDirtiesContextT
5757
/**
5858
* Returns {@code 3000}, which ensures that the {@code DirtiesContextTestExecutionListener}
5959
* is ordered after the
60-
* {@link org.springframework.test.context.support.DependencyInjectionTestExecutionListener
61-
* DependencyInjectionTestExecutionListener} and just before the
62-
* {@link org.springframework.test.context.support.CommonCachesTestExecutionListener
63-
* CommonCachesTestExecutionListener}.
60+
* {@link DependencyInjectionTestExecutionListener DependencyInjectionTestExecutionListener}
61+
* and before the {@link CommonCachesTestExecutionListener CommonCachesTestExecutionListener}.
6462
*/
6563
@Override
6664
public final int getOrder() {

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 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.
@@ -180,7 +180,7 @@ private TransactionAttribute findTransactionAttributeInEnclosingClassHierarchy(C
180180
* Returns {@code 4000}, which ensures that the {@code TransactionalTestExecutionListener}
181181
* is ordered after the
182182
* {@link org.springframework.test.context.support.CommonCachesTestExecutionListener
183-
* CommonCachesTestExecutionListener} and just before the
183+
* CommonCachesTestExecutionListener} and before the
184184
* {@link org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener
185185
* SqlScriptsTestExecutionListener}.
186186
*/

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

+1-1
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.

0 commit comments

Comments
 (0)