Skip to content

Commit

Permalink
Document order values for TestExecutionListener implementations
Browse files Browse the repository at this point in the history
Closes gh-34265

Signed-off-by: Mengqi Xu <[email protected]>
  • Loading branch information
remeio authored and sbrannen committed Feb 11, 2025
1 parent 16e3973 commit 128e900
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@
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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,12 @@ public MicrometerObservationRegistryTestExecutionListener() {


/**
* 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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@
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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@
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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@
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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,12 @@ private TransactionAttribute findTransactionAttributeInEnclosingClassHierarchy(C


/**
* 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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 128e900

Please sign in to comment.