Skip to content

GC-1074 - descripe pitfall with andWaitForEventOfType #1145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,11 @@ public <S> StateChangeResult<S> forStateChange(Supplier<S> supplier, Predicate<?
* Expects an event of the given type to arrive. Use API on the returned {@link EventResult} to specify more
* detailed expectations and conclude those with a call a flavor of {@link EventResult#toArrive()}.
*
* Please note that events can only be recorded and taken into account by this method if they are published within
* the executing thread (the one that executes the test) or child threads of this (which is used with @Async, for
* example). If events are published in independent threads, this method does not react to them. In this case, you
* must work with your own {@link ApplicationModuleListener} and {@link When#andWaitForStateChange(Supplier)}.
*
* @param <E> the type of the event.
* @param type must not be {@literal null}.
* @return will never be {@literal null}.
Expand Down Expand Up @@ -462,6 +467,11 @@ public void andVerifyEvents(Consumer<AssertablePublishedEvents> events) {
* Expects an event of the given type to arrive eventually. Use API on the returned {@link EventResult} to specify
* more detailed expectations and conclude those with a call a flavor of {@link EventResult#toArrive()}.
*
* Please note that events can only be recorded and taken into account by this method if they are published within
* the executing thread (the one that executes the test) or child threads of this (which is used with @Async, for
* example). If events are published in independent threads, this method does not react to them. In this case, you
* must work with your own {@link ApplicationModuleListener} and {@link When#andWaitForStateChange(Supplier)}.
*
* @param <E> the type of the event
* @param eventType must not be {@literal null}.
* @return will never be {@literal null}.
Expand Down