Overview

The Javadoc for all "after" callback methods in TestContextManager (such as afterTestExecution()) states the following.

Note that listeners will be executed in the opposite order in which they were registered.

However, most developers would not logically think to read the Javadoc for TestContextManager when trying to reason about TestExecutionListener callbacks.

Therefore, as mentioned by @nizametdinovcrx in https://github.com/spring-projects/spring-framework/issues/34225#issuecomment-2599862038, we should officially document the "wrapping behavior" of TestExecutionListener callbacks, especially with regard to the fact that "after" callbacks are invoked in reverse registration order.

Since I authored the documentation for JUnit Jupiter's Wrapping Behavior of Callbacks, I will likely borrow from that.

Related Issues

  • https://github.com/junit-team/junit5/issues/1620
  • 34225