Browse Source

Revise TestExecutionListener order values documentation

See gh-34265
pull/34656/head
Sam Brannen 10 months ago
parent
commit
09086fc648
  1. 4
      spring-test/src/main/java/org/springframework/test/context/bean/override/BeanOverrideTestExecutionListener.java
  2. 4
      spring-test/src/main/java/org/springframework/test/context/bean/override/mockito/MockitoResetTestExecutionListener.java
  3. 8
      spring-test/src/main/java/org/springframework/test/context/event/ApplicationEventsTestExecutionListener.java
  4. 6
      spring-test/src/main/java/org/springframework/test/context/event/EventPublishingTestExecutionListener.java
  5. 4
      spring-test/src/main/java/org/springframework/test/context/jdbc/SqlScriptsTestExecutionListener.java
  6. 8
      spring-test/src/main/java/org/springframework/test/context/observation/MicrometerObservationRegistryTestExecutionListener.java
  7. 5
      spring-test/src/main/java/org/springframework/test/context/support/CommonCachesTestExecutionListener.java
  8. 14
      spring-test/src/main/java/org/springframework/test/context/support/DependencyInjectionTestExecutionListener.java
  9. 6
      spring-test/src/main/java/org/springframework/test/context/support/DirtiesContextBeforeModesTestExecutionListener.java
  10. 8
      spring-test/src/main/java/org/springframework/test/context/support/DirtiesContextTestExecutionListener.java
  11. 4
      spring-test/src/main/java/org/springframework/test/context/transaction/TransactionalTestExecutionListener.java
  12. 2
      spring-test/src/main/java/org/springframework/test/context/web/ServletTestExecutionListener.java

4
spring-test/src/main/java/org/springframework/test/context/bean/override/BeanOverrideTestExecutionListener.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -40,7 +40,7 @@ public class BeanOverrideTestExecutionListener extends AbstractTestExecutionList @@ -40,7 +40,7 @@ public class BeanOverrideTestExecutionListener extends AbstractTestExecutionList
* Returns {@code 1950}, which ensures that the {@code BeanOverrideTestExecutionListener}
* is ordered after the
* {@link org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener
* DirtiesContextBeforeModesTestExecutionListener} and just before the
* DirtiesContextBeforeModesTestExecutionListener} and before the
* {@link DependencyInjectionTestExecutionListener}.
*/
@Override

4
spring-test/src/main/java/org/springframework/test/context/bean/override/mockito/MockitoResetTestExecutionListener.java

@ -74,7 +74,9 @@ public class MockitoResetTestExecutionListener extends AbstractTestExecutionList @@ -74,7 +74,9 @@ public class MockitoResetTestExecutionListener extends AbstractTestExecutionList
/**
* Returns {@code Ordered.LOWEST_PRECEDENCE - 100}.
* Returns {@code Ordered.LOWEST_PRECEDENCE - 100}, which ensures that the
* {@code MockitoResetTestExecutionListener} is ordered after all standard
* {@code TestExecutionListener} implementations.
*/
@Override
public int getOrder() {

8
spring-test/src/main/java/org/springframework/test/context/event/ApplicationEventsTestExecutionListener.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -64,9 +64,11 @@ public class ApplicationEventsTestExecutionListener extends AbstractTestExecutio @@ -64,9 +64,11 @@ public class ApplicationEventsTestExecutionListener extends AbstractTestExecutio
* Returns {@code 1800}, which ensures that the {@code ApplicationEventsTestExecutionListener}
* is ordered after the
* {@link org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener
* DirtiesContextBeforeModesTestExecutionListener} and just before the
* DirtiesContextBeforeModesTestExecutionListener} and before the
* {@link org.springframework.test.context.bean.override.BeanOverrideTestExecutionListener
* BeanOverrideTestExecutionListener}.
* BeanOverrideTestExecutionListener} and the
* {@link org.springframework.test.context.support.DependencyInjectionTestExecutionListener
* DependencyInjectionTestExecutionListener}.
*/
@Override
public final int getOrder() {

6
spring-test/src/main/java/org/springframework/test/context/event/EventPublishingTestExecutionListener.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -101,7 +101,9 @@ public class EventPublishingTestExecutionListener extends AbstractTestExecutionL @@ -101,7 +101,9 @@ public class EventPublishingTestExecutionListener extends AbstractTestExecutionL
* Returns {@code 10000}, which ensures that the {@code EventPublishingTestExecutionListener}
* is ordered after the
* {@link org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener
* SqlScriptsTestExecutionListener}.
* SqlScriptsTestExecutionListener} and before the
* {@link org.springframework.test.context.bean.override.mockito.MockitoResetTestExecutionListener
* MockitoResetTestExecutionListener}.
*/
@Override
public final int getOrder() {

4
spring-test/src/main/java/org/springframework/test/context/jdbc/SqlScriptsTestExecutionListener.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -129,7 +129,7 @@ public class SqlScriptsTestExecutionListener extends AbstractTestExecutionListen @@ -129,7 +129,7 @@ public class SqlScriptsTestExecutionListener extends AbstractTestExecutionListen
* Returns {@code 5000}, which ensures that the {@code SqlScriptsTestExecutionListener}
* is ordered after the
* {@link org.springframework.test.context.transaction.TransactionalTestExecutionListener
* TransactionalTestExecutionListener} and just before the
* TransactionalTestExecutionListener} and before the
* {@link org.springframework.test.context.event.EventPublishingTestExecutionListener
* EventPublishingTestExecutionListener}.
*/

8
spring-test/src/main/java/org/springframework/test/context/observation/MicrometerObservationRegistryTestExecutionListener.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -107,10 +107,10 @@ class MicrometerObservationRegistryTestExecutionListener extends AbstractTestExe @@ -107,10 +107,10 @@ class MicrometerObservationRegistryTestExecutionListener extends AbstractTestExe
/**
* Returns {@code 2500}, which ensures that the {@code MicrometerObservationRegistryTestExecutionListener}
* is ordered after the
* Returns {@code 2500}, which ensures that the
* {@code MicrometerObservationRegistryTestExecutionListener} is ordered after the
* {@link org.springframework.test.context.support.DependencyInjectionTestExecutionListener
* DependencyInjectionTestExecutionListener} and just before the
* DependencyInjectionTestExecutionListener} and before the
* {@link org.springframework.test.context.support.DirtiesContextTestExecutionListener
* DirtiesContextTestExecutionListener}.
*/

5
spring-test/src/main/java/org/springframework/test/context/support/CommonCachesTestExecutionListener.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -38,8 +38,7 @@ public class CommonCachesTestExecutionListener extends AbstractTestExecutionList @@ -38,8 +38,7 @@ public class CommonCachesTestExecutionListener extends AbstractTestExecutionList
/**
* Returns {@code 3005}, which ensures that the {@code CommonCachesTestExecutionListener}
* is ordered after the
* {@link org.springframework.test.context.support.DirtiesContextTestExecutionListener
* DirtiesContextTestExecutionListener} and just before the
* {@link DirtiesContextTestExecutionListener DirtiesContextTestExecutionListener} and before the
* {@link org.springframework.test.context.transaction.TransactionalTestExecutionListener
* TransactionalTestExecutionListener}.
*/

14
spring-test/src/main/java/org/springframework/test/context/support/DependencyInjectionTestExecutionListener.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -63,12 +63,14 @@ public class DependencyInjectionTestExecutionListener extends AbstractTestExecut @@ -63,12 +63,14 @@ public class DependencyInjectionTestExecutionListener extends AbstractTestExecut
/**
* Returns {@code 2000}, which ensures that the {@code ApplicationEventsTestExecutionListener}
* Returns {@code 2000}, which ensures that the {@code DependencyInjectionTestExecutionListener}
* is ordered after the
* {@link org.springframework.test.context.bean.override.BeanOverrideTestExecutionListener
* BeanOverrideTestExecutionListener} and just before the
* {@link org.springframework.test.context.support.DirtiesContextTestExecutionListener
* DirtiesContextTestExecutionListener}.
* {@link DirtiesContextBeforeModesTestExecutionListener DirtiesContextBeforeModesTestExecutionListener}
* and the {@link org.springframework.test.context.bean.override.BeanOverrideTestExecutionListener
* BeanOverrideTestExecutionListener} and before the
* {@link org.springframework.test.context.observation.MicrometerObservationRegistryTestExecutionListener
* MicrometerObservationRegistryTestExecutionListener} and the
* {@link DirtiesContextTestExecutionListener DirtiesContextTestExecutionListener}.
*/
@Override
public final int getOrder() {

6
spring-test/src/main/java/org/springframework/test/context/support/DirtiesContextBeforeModesTestExecutionListener.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -58,7 +58,9 @@ public class DirtiesContextBeforeModesTestExecutionListener extends AbstractDirt @@ -58,7 +58,9 @@ public class DirtiesContextBeforeModesTestExecutionListener extends AbstractDirt
* Returns {@code 1500}, which ensures that the {@code DirtiesContextBeforeModesTestExecutionListener}
* is ordered after the
* {@link org.springframework.test.context.web.ServletTestExecutionListener
* ServletTestExecutionListener} and just before the
* ServletTestExecutionListener} and before the
* {@link org.springframework.test.context.event.ApplicationEventsTestExecutionListener
* ApplicationEventsTestExecutionListener} and the
* {@link org.springframework.test.context.bean.override.BeanOverrideTestExecutionListener
* BeanOverrideTestExecutionListener}.
*/

8
spring-test/src/main/java/org/springframework/test/context/support/DirtiesContextTestExecutionListener.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -57,10 +57,8 @@ public class DirtiesContextTestExecutionListener extends AbstractDirtiesContextT @@ -57,10 +57,8 @@ public class DirtiesContextTestExecutionListener extends AbstractDirtiesContextT
/**
* Returns {@code 3000}, which ensures that the {@code DirtiesContextTestExecutionListener}
* is ordered after the
* {@link org.springframework.test.context.support.DependencyInjectionTestExecutionListener
* DependencyInjectionTestExecutionListener} and just before the
* {@link org.springframework.test.context.support.CommonCachesTestExecutionListener
* CommonCachesTestExecutionListener}.
* {@link DependencyInjectionTestExecutionListener DependencyInjectionTestExecutionListener}
* and before the {@link CommonCachesTestExecutionListener CommonCachesTestExecutionListener}.
*/
@Override
public final int getOrder() {

4
spring-test/src/main/java/org/springframework/test/context/transaction/TransactionalTestExecutionListener.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -180,7 +180,7 @@ public class TransactionalTestExecutionListener extends AbstractTestExecutionLis @@ -180,7 +180,7 @@ public class TransactionalTestExecutionListener extends AbstractTestExecutionLis
* Returns {@code 4000}, which ensures that the {@code TransactionalTestExecutionListener}
* is ordered after the
* {@link org.springframework.test.context.support.CommonCachesTestExecutionListener
* CommonCachesTestExecutionListener} and just before the
* CommonCachesTestExecutionListener} and before the
* {@link org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener
* SqlScriptsTestExecutionListener}.
*/

2
spring-test/src/main/java/org/springframework/test/context/web/ServletTestExecutionListener.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

Loading…
Cancel
Save