@RecordApplicationEvents

@RecordApplicationEvents is an annotation that can be applied to a test class to instruct the Spring TestContext Framework to record all application events that are published in the ApplicationContext during the execution of a single test.

The recorded events can be accessed via the ApplicationEvents API within tests.

See Application Events and the @RecordApplicationEvents javadoc for an example and further details.