See https://github.com/spring-projects/spring-boot/issues/41439#issuecomment-2303907367.

We should try to make things work seamlessly with JUnit and possibly consider making some form of EventPublisherBeansContextWrapper.addWrapperIfNecessary public so that folks can all it directly.

Comment From: wilkinsona

Somewhat related to this, shouldPublishEventsWhenContextStorageIsInitializedEarly() in OpenTelemetryAutoConfigurationTests is 100% flaky at the moment.