Document order values for TestExecutionListener implementations

Closes gh-34265

Signed-off-by: Mengqi Xu <2663479778@qq.com>
This commit is contained in:
Mengqi Xu
2025-01-15 22:30:43 +08:00
committed by Sam Brannen
parent 16e3973118
commit 128e90064e
10 changed files with 56 additions and 10 deletions

View File

@@ -61,7 +61,12 @@ public class ApplicationEventsTestExecutionListener extends AbstractTestExecutio
/**
* Returns {@code 1800}.
* 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
* {@link org.springframework.test.context.bean.override.BeanOverrideTestExecutionListener
* BeanOverrideTestExecutionListener}.
*/
@Override
public final int getOrder() {

View File

@@ -98,7 +98,10 @@ import org.springframework.test.context.support.AbstractTestExecutionListener;
public class EventPublishingTestExecutionListener extends AbstractTestExecutionListener {
/**
* Returns {@code 10000}.
* Returns {@code 10000}, which ensures that the {@code EventPublishingTestExecutionListener}
* is ordered after the
* {@link org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener
* SqlScriptsTestExecutionListener}.
*/
@Override
public final int getOrder() {

View File

@@ -126,7 +126,12 @@ public class SqlScriptsTestExecutionListener extends AbstractTestExecutionListen
/**
* Returns {@code 5000}.
* 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
* {@link org.springframework.test.context.event.EventPublishingTestExecutionListener
* EventPublishingTestExecutionListener}.
*/
@Override
public final int getOrder() {

View File

@@ -107,7 +107,12 @@ class MicrometerObservationRegistryTestExecutionListener extends AbstractTestExe
/**
* Returns {@code 2500}.
* 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
* {@link org.springframework.test.context.support.DirtiesContextTestExecutionListener
* DirtiesContextTestExecutionListener}.
*/
@Override
public final int getOrder() {

View File

@@ -36,7 +36,12 @@ import org.springframework.test.context.TestContext;
public class CommonCachesTestExecutionListener extends AbstractTestExecutionListener {
/**
* Returns {@code 3005}.
* 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 org.springframework.test.context.transaction.TransactionalTestExecutionListener
* TransactionalTestExecutionListener}.
*/
@Override
public final int getOrder() {

View File

@@ -63,7 +63,12 @@ public class DependencyInjectionTestExecutionListener extends AbstractTestExecut
/**
* Returns {@code 2000}.
* Returns {@code 2000}, which ensures that the {@code ApplicationEventsTestExecutionListener}
* 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}.
*/
@Override
public final int getOrder() {

View File

@@ -55,7 +55,12 @@ import static org.springframework.test.annotation.DirtiesContext.MethodMode.BEFO
public class DirtiesContextBeforeModesTestExecutionListener extends AbstractDirtiesContextTestExecutionListener {
/**
* Returns {@code 1500}.
* 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
* {@link org.springframework.test.context.bean.override.BeanOverrideTestExecutionListener
* BeanOverrideTestExecutionListener}.
*/
@Override
public final int getOrder() {

View File

@@ -55,7 +55,12 @@ import static org.springframework.test.annotation.DirtiesContext.MethodMode.AFTE
public class DirtiesContextTestExecutionListener extends AbstractDirtiesContextTestExecutionListener {
/**
* Returns {@code 3000}.
* 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}.
*/
@Override
public final int getOrder() {

View File

@@ -177,7 +177,12 @@ public class TransactionalTestExecutionListener extends AbstractTestExecutionLis
/**
* Returns {@code 4000}.
* 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
* {@link org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener
* SqlScriptsTestExecutionListener}.
*/
@Override
public final int getOrder() {

View File

@@ -110,7 +110,10 @@ public class ServletTestExecutionListener extends AbstractTestExecutionListener
/**
* Returns {@code 1000}.
* Returns {@code 1000}, which ensures that the {@code ServletTestExecutionListener}
* is ordered before the
* {@link org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener
* DirtiesContextBeforeModesTestExecutionListener}.
*/
@Override
public final int getOrder() {