Browse Source

Polish RecordApplicationEvents javadoc: add note on captured threads

This commit clarifies that the annotation is used to capture events that
are fired from the test `Thread` or descendant threads, since the test
framework uses `InheritableThreadLocal` to store captured events now.

See gh-31079
See gh-30020
pull/31587/head
Simon Baslé 1 year ago
parent
commit
42874178ce
  1. 3
      spring-test/src/main/java/org/springframework/test/context/event/RecordApplicationEvents.java

3
spring-test/src/main/java/org/springframework/test/context/event/RecordApplicationEvents.java

@ -28,7 +28,8 @@ import java.lang.annotation.Target;
* instruct the <em>Spring TestContext Framework</em> to record all * instruct the <em>Spring TestContext Framework</em> to record all
* {@linkplain org.springframework.context.ApplicationEvent application events} * {@linkplain org.springframework.context.ApplicationEvent application events}
* that are published in the {@link org.springframework.context.ApplicationContext * that are published in the {@link org.springframework.context.ApplicationContext
* ApplicationContext} during the execution of a single test. * ApplicationContext} during the execution of a single test, either from the
* test thread or its descendants.
* *
* <p>The recorded events can be accessed via the {@link ApplicationEvents} API * <p>The recorded events can be accessed via the {@link ApplicationEvents} API
* within your tests. * within your tests.

Loading…
Cancel
Save