@RecordApplicationEvents

@RecordApplicationEvents 是一种注解,它可以应用于一个测试类,指示 Spring TestContext 框架 记录在单个测试执行期间 ApplicationContext 中发布的所有应用程序事件。

@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.

记录的事件可以通过测试中的 ApplicationEvents API 进行访问。

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

有关示例和进一步的详细信息,请参见 Application Events@RecordApplicationEvents javadoc

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