Document the effect of @DirtiesContext on test execution events

See gh-27757
This commit is contained in:
Sam Brannen
2022-03-12 16:02:20 +01:00
parent 8a510db00d
commit d9c22e657f
3 changed files with 245 additions and 1 deletions

View File

@@ -63,7 +63,10 @@ import org.springframework.test.context.support.AbstractTestExecutionListener;
* register a {@code TestExecutionListener} that loads the {@code ApplicationContext}
* in the {@link org.springframework.test.context.TestExecutionListener#beforeTestClass
* beforeTestClass} callback, and that {@code TestExecutionListener} must be registered
* before the {@code EventPublishingTestExecutionListener}.
* before the {@code EventPublishingTestExecutionListener}. Similarly, if
* {@code @DirtiesContext} is used to remove the {@code ApplicationContext} from
* the context cache after the last test method in a given test class, the
* {@code AfterTestClassEvent} will not be published for that test class.
*
* <h3>Exception Handling</h3>
* <p>By default, if a test event listener throws an exception while consuming