File tree 12 files changed +99
-25
lines changed
spring-test/src/main/java/org/springframework/test/context
12 files changed +99
-25
lines changed Original file line number Diff line number Diff line change 37
37
public class BeanOverrideTestExecutionListener extends AbstractTestExecutionListener {
38
38
39
39
/**
40
- * Returns {@code 1950}, which ensures that the {@code BeanOverrideTestExecutionListener}
40
+ * The {@link #getOrder() order} value for this listener: {@value}.
41
+ * @since 6.2.3
42
+ */
43
+ public static final int ORDER = 1950 ;
44
+
45
+ /**
46
+ * Returns {@value #ORDER}, which ensures that the {@code BeanOverrideTestExecutionListener}
41
47
* is ordered after the
42
48
* {@link org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener
43
49
* DirtiesContextBeforeModesTestExecutionListener} and before the
44
50
* {@link DependencyInjectionTestExecutionListener}.
45
51
*/
46
52
@ Override
47
53
public int getOrder () {
48
- return 1950 ;
54
+ return ORDER ;
49
55
}
50
56
51
57
/**
Original file line number Diff line number Diff line change 49
49
*/
50
50
public class MockitoResetTestExecutionListener extends AbstractTestExecutionListener {
51
51
52
+ /**
53
+ * The {@link #getOrder() order} value for this listener
54
+ * ({@code Ordered.LOWEST_PRECEDENCE - 100}): {@value}.
55
+ * @since 6.2.3
56
+ */
57
+ public static final int ORDER = Ordered .LOWEST_PRECEDENCE - 100 ;
58
+
52
59
private static final Log logger = LogFactory .getLog (MockitoResetTestExecutionListener .class );
53
60
54
61
/**
@@ -74,9 +81,10 @@ public class MockitoResetTestExecutionListener extends AbstractTestExecutionList
74
81
75
82
76
83
/**
77
- * Returns {@code Ordered.LOWEST_PRECEDENCE - 100 }, which ensures that the
84
+ * Returns {@value #ORDER }, which ensures that the
78
85
* {@code MockitoResetTestExecutionListener} is ordered after all standard
79
86
* {@code TestExecutionListener} implementations.
87
+ * @see #ORDER
80
88
*/
81
89
@ Override
82
90
public int getOrder () {
Original file line number Diff line number Diff line change 48
48
*/
49
49
public class ApplicationEventsTestExecutionListener extends AbstractTestExecutionListener {
50
50
51
+ /**
52
+ * The {@link #getOrder() order} value for this listener: {@value}.
53
+ * @since 6.2.3
54
+ */
55
+ public static final int ORDER = 1800 ;
56
+
51
57
/**
52
58
* Attribute name for a {@link TestContext} attribute which indicates
53
59
* whether the test class for the given test context is annotated with
@@ -61,7 +67,7 @@ public class ApplicationEventsTestExecutionListener extends AbstractTestExecutio
61
67
62
68
63
69
/**
64
- * Returns {@code 1800 }, which ensures that the {@code ApplicationEventsTestExecutionListener}
70
+ * Returns {@value #ORDER }, which ensures that the {@code ApplicationEventsTestExecutionListener}
65
71
* is ordered after the
66
72
* {@link org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener
67
73
* DirtiesContextBeforeModesTestExecutionListener} and before the
@@ -72,7 +78,7 @@ public class ApplicationEventsTestExecutionListener extends AbstractTestExecutio
72
78
*/
73
79
@ Override
74
80
public final int getOrder () {
75
- return 1800 ;
81
+ return ORDER ;
76
82
}
77
83
78
84
@ Override
Original file line number Diff line number Diff line change 98
98
public class EventPublishingTestExecutionListener extends AbstractTestExecutionListener {
99
99
100
100
/**
101
- * Returns {@code 10000}, which ensures that the {@code EventPublishingTestExecutionListener}
101
+ * The {@link #getOrder() order} value for this listener: {@value}.
102
+ * @since 6.2.3
103
+ */
104
+ public static final int ORDER = 10_000 ;
105
+
106
+ /**
107
+ * Returns {@value #ORDER}, which ensures that the {@code EventPublishingTestExecutionListener}
102
108
* is ordered after the
103
109
* {@link org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener
104
110
* SqlScriptsTestExecutionListener} and before the
@@ -107,7 +113,7 @@ public class EventPublishingTestExecutionListener extends AbstractTestExecutionL
107
113
*/
108
114
@ Override
109
115
public final int getOrder () {
110
- return 10_000 ;
116
+ return ORDER ;
111
117
}
112
118
113
119
/**
Original file line number Diff line number Diff line change 117
117
*/
118
118
public class SqlScriptsTestExecutionListener extends AbstractTestExecutionListener implements AotTestExecutionListener {
119
119
120
+ /**
121
+ * The {@link #getOrder() order} value for this listener: {@value}.
122
+ * @since 6.2.3
123
+ */
124
+ public static final int ORDER = 5000 ;
125
+
120
126
private static final String SLASH = "/" ;
121
127
122
128
private static final Log logger = LogFactory .getLog (SqlScriptsTestExecutionListener .class );
@@ -126,7 +132,7 @@ public class SqlScriptsTestExecutionListener extends AbstractTestExecutionListen
126
132
127
133
128
134
/**
129
- * Returns {@code 5000 }, which ensures that the {@code SqlScriptsTestExecutionListener}
135
+ * Returns {@value #ORDER }, which ensures that the {@code SqlScriptsTestExecutionListener}
130
136
* is ordered after the
131
137
* {@link org.springframework.test.context.transaction.TransactionalTestExecutionListener
132
138
* TransactionalTestExecutionListener} and before the
@@ -135,7 +141,7 @@ public class SqlScriptsTestExecutionListener extends AbstractTestExecutionListen
135
141
*/
136
142
@ Override
137
143
public final int getOrder () {
138
- return 5000 ;
144
+ return ORDER ;
139
145
}
140
146
141
147
/**
Original file line number Diff line number Diff line change 44
44
*/
45
45
class MicrometerObservationRegistryTestExecutionListener extends AbstractTestExecutionListener {
46
46
47
+ /**
48
+ * The {@link #getOrder() order} value for this listener: {@value}.
49
+ * @since 6.2.3
50
+ */
51
+ public static final int ORDER = 2500 ;
52
+
47
53
private static final Log logger = LogFactory .getLog (MicrometerObservationRegistryTestExecutionListener .class );
48
54
49
55
/**
@@ -107,7 +113,7 @@ public MicrometerObservationRegistryTestExecutionListener() {
107
113
108
114
109
115
/**
110
- * Returns {@code 2500 }, which ensures that the
116
+ * Returns {@value #ORDER }, which ensures that the
111
117
* {@code MicrometerObservationRegistryTestExecutionListener} is ordered after the
112
118
* {@link org.springframework.test.context.support.DependencyInjectionTestExecutionListener
113
119
* DependencyInjectionTestExecutionListener} and before the
@@ -116,7 +122,7 @@ public MicrometerObservationRegistryTestExecutionListener() {
116
122
*/
117
123
@ Override
118
124
public final int getOrder () {
119
- return 2500 ;
125
+ return ORDER ;
120
126
}
121
127
122
128
/**
Original file line number Diff line number Diff line change 36
36
public class CommonCachesTestExecutionListener extends AbstractTestExecutionListener {
37
37
38
38
/**
39
- * Returns {@code 3005}, which ensures that the {@code CommonCachesTestExecutionListener}
39
+ * The {@link #getOrder() order} value for this listener: {@value}.
40
+ * @since 6.2.3
41
+ */
42
+ public static final int ORDER = 3005 ;
43
+
44
+
45
+ /**
46
+ * Returns {@value #ORDER}, which ensures that the {@code CommonCachesTestExecutionListener}
40
47
* is ordered after the
41
48
* {@link DirtiesContextTestExecutionListener DirtiesContextTestExecutionListener} and before the
42
49
* {@link org.springframework.test.context.transaction.TransactionalTestExecutionListener
43
50
* TransactionalTestExecutionListener}.
44
51
*/
45
52
@ Override
46
53
public final int getOrder () {
47
- return 3005 ;
54
+ return ORDER ;
48
55
}
49
56
50
-
51
57
@ Override
52
58
public void afterTestClass (TestContext testContext ) throws Exception {
53
59
if (testContext .hasApplicationContext ()) {
Original file line number Diff line number Diff line change 39
39
*/
40
40
public class DependencyInjectionTestExecutionListener extends AbstractTestExecutionListener {
41
41
42
+ /**
43
+ * The {@link #getOrder() order} value for this listener: {@value}.
44
+ * @since 6.2.3
45
+ */
46
+ public static final int ORDER = 2000 ;
47
+
42
48
/**
43
49
* Attribute name for a {@link TestContext} attribute which indicates
44
50
* whether the dependencies of a test instance should be
@@ -63,7 +69,7 @@ public class DependencyInjectionTestExecutionListener extends AbstractTestExecut
63
69
64
70
65
71
/**
66
- * Returns {@code 2000 }, which ensures that the {@code DependencyInjectionTestExecutionListener}
72
+ * Returns {@value #ORDER }, which ensures that the {@code DependencyInjectionTestExecutionListener}
67
73
* is ordered after the
68
74
* {@link DirtiesContextBeforeModesTestExecutionListener DirtiesContextBeforeModesTestExecutionListener}
69
75
* and the {@link org.springframework.test.context.bean.override.BeanOverrideTestExecutionListener
@@ -74,7 +80,7 @@ public class DependencyInjectionTestExecutionListener extends AbstractTestExecut
74
80
*/
75
81
@ Override
76
82
public final int getOrder () {
77
- return 2000 ;
83
+ return ORDER ;
78
84
}
79
85
80
86
/**
Original file line number Diff line number Diff line change 55
55
public class DirtiesContextBeforeModesTestExecutionListener extends AbstractDirtiesContextTestExecutionListener {
56
56
57
57
/**
58
- * Returns {@code 1500}, which ensures that the {@code DirtiesContextBeforeModesTestExecutionListener}
59
- * is ordered after the
58
+ * The {@link #getOrder() order} value for this listener: {@value}.
59
+ * @since 6.2.3
60
+ */
61
+ public static final int ORDER = 1500 ;
62
+
63
+ /**
64
+ * Returns {@value #ORDER}, which ensures that the
65
+ * {@code DirtiesContextBeforeModesTestExecutionListener} is ordered after the
60
66
* {@link org.springframework.test.context.web.ServletTestExecutionListener
61
67
* ServletTestExecutionListener} and before the
62
68
* {@link org.springframework.test.context.event.ApplicationEventsTestExecutionListener
@@ -66,7 +72,7 @@ public class DirtiesContextBeforeModesTestExecutionListener extends AbstractDirt
66
72
*/
67
73
@ Override
68
74
public final int getOrder () {
69
- return 1500 ;
75
+ return ORDER ;
70
76
}
71
77
72
78
/**
Original file line number Diff line number Diff line change 55
55
public class DirtiesContextTestExecutionListener extends AbstractDirtiesContextTestExecutionListener {
56
56
57
57
/**
58
- * Returns {@code 3000}, which ensures that the {@code DirtiesContextTestExecutionListener}
58
+ * The {@link #getOrder() order} value for this listener: {@value}.
59
+ * @since 6.2.3
60
+ */
61
+ public static final int ORDER = 3000 ;
62
+
63
+ /**
64
+ * Returns {@value #ORDER}, which ensures that the {@code DirtiesContextTestExecutionListener}
59
65
* is ordered after the
60
66
* {@link DependencyInjectionTestExecutionListener DependencyInjectionTestExecutionListener}
61
67
* and before the {@link CommonCachesTestExecutionListener CommonCachesTestExecutionListener}.
62
68
*/
63
69
@ Override
64
70
public final int getOrder () {
65
- return 3000 ;
71
+ return ORDER ;
66
72
}
67
73
68
74
/**
Original file line number Diff line number Diff line change 148
148
*/
149
149
public class TransactionalTestExecutionListener extends AbstractTestExecutionListener {
150
150
151
+ /**
152
+ * The {@link #getOrder() order} value for this listener: {@value}.
153
+ * @since 6.2.3
154
+ */
155
+ public static final int ORDER = 4000 ;
156
+
151
157
private static final Log logger = LogFactory .getLog (TransactionalTestExecutionListener .class );
152
158
153
159
// Do not require @Transactional test methods to be public.
@@ -177,7 +183,7 @@ private TransactionAttribute findTransactionAttributeInEnclosingClassHierarchy(C
177
183
178
184
179
185
/**
180
- * Returns {@code 4000 }, which ensures that the {@code TransactionalTestExecutionListener}
186
+ * Returns {@value #ORDER }, which ensures that the {@code TransactionalTestExecutionListener}
181
187
* is ordered after the
182
188
* {@link org.springframework.test.context.support.CommonCachesTestExecutionListener
183
189
* CommonCachesTestExecutionListener} and before the
@@ -186,7 +192,7 @@ private TransactionAttribute findTransactionAttributeInEnclosingClassHierarchy(C
186
192
*/
187
193
@ Override
188
194
public final int getOrder () {
189
- return 4000 ;
195
+ return ORDER ;
190
196
}
191
197
192
198
/**
Original file line number Diff line number Diff line change 64
64
*/
65
65
public class ServletTestExecutionListener extends AbstractTestExecutionListener {
66
66
67
+ /**
68
+ * The {@link #getOrder() order} value for this listener: {@value}.
69
+ * @since 6.2.3
70
+ */
71
+ public static final int ORDER = 1000 ;
72
+
67
73
/**
68
74
* Attribute name for a {@link TestContext} attribute which indicates
69
75
* whether the {@code ServletTestExecutionListener} should {@linkplain
@@ -110,14 +116,14 @@ public class ServletTestExecutionListener extends AbstractTestExecutionListener
110
116
111
117
112
118
/**
113
- * Returns {@code 1000 }, which ensures that the {@code ServletTestExecutionListener}
119
+ * Returns {@value #ORDER }, which ensures that the {@code ServletTestExecutionListener}
114
120
* is ordered before the
115
121
* {@link org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener
116
122
* DirtiesContextBeforeModesTestExecutionListener}.
117
123
*/
118
124
@ Override
119
125
public final int getOrder () {
120
- return 1000 ;
126
+ return ORDER ;
121
127
}
122
128
123
129
/**
You can’t perform that action at this time.
0 commit comments