Files
spring-framework/spring-test
Sam Brannen cf5d0e6aa9 Introduce publishEvent() convenience method in TestContext
This commit introduces a publishEvent() method in the TestContext API
as a convenience for publishing an ApplicationEvent to the test's
ApplicationContext but only if the ApplicationContext is currently
available and with lazy creation of the ApplicationEvent.

For example, the beforeTestClass() method in
EventPublishingTestExecutionListener is now implemented as follows.

  public void beforeTestClass(TestContext testContext) {
      testContext.publishEvent(BeforeTestClassEvent::new);
  }

Closes gh-22765
2019-04-08 15:14:39 +02:00
..
2019-04-04 16:12:07 +02:00