@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.spring-doc.cn

The recorded events can be accessed via the ApplicationEvents API within tests.spring-doc.cn

See Application Events and the @RecordApplicationEvents javadoc for an example and further details.spring-doc.cn