From 42874178ceb3381ecc6241ec0cf8e9c512506b1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Basl=C3=A9?= Date: Thu, 9 Nov 2023 11:07:28 +0100 Subject: [PATCH] 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 --- .../test/context/event/RecordApplicationEvents.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-test/src/main/java/org/springframework/test/context/event/RecordApplicationEvents.java b/spring-test/src/main/java/org/springframework/test/context/event/RecordApplicationEvents.java index 542fbdacabc9..804594268d7f 100644 --- a/spring-test/src/main/java/org/springframework/test/context/event/RecordApplicationEvents.java +++ b/spring-test/src/main/java/org/springframework/test/context/event/RecordApplicationEvents.java @@ -28,7 +28,8 @@ * instruct the Spring TestContext Framework to record all * {@linkplain org.springframework.context.ApplicationEvent application events} * 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. * *

The recorded events can be accessed via the {@link ApplicationEvents} API * within your tests.