Polish annotation-driven event listener support

This commit is contained in:
Sam Brannen
2019-03-14 23:13:41 +01:00
parent 0b53dbf38f
commit fef43048b2
5 changed files with 25 additions and 21 deletions

View File

@@ -50,8 +50,8 @@ public abstract class TestContextEvent extends ApplicationEvent {
/**
* Alias for {@link #getSource()}.
* <p>This method may be favored over {@code getSource()} to improve readability
* in SpEL expressions for event processing
* <p>This method may be favored over {@code getSource()} &mdash; for example,
* to improve readability in SpEL expressions for event processing
* {@linkplain org.springframework.context.event.EventListener#condition conditions}.
* @return the {@code TestContext} associated with this event (never {@code null})
* @see #getSource()

View File

@@ -272,12 +272,12 @@ public class EventPublishingTestExecutionListenerIntegrationTests {
throw new RuntimeException("Boom!");
}
@BeforeTestExecution
@BeforeTestExecution("'yes'")
public void beforeTestExecution(BeforeTestExecutionEvent e) throws Exception {
listener().beforeTestExecution(e.getSource());
}
@AfterTestExecution
@AfterTestExecution("'1'")
public void afterTestExecution(AfterTestExecutionEvent e) throws Exception {
listener().afterTestExecution(e.getSource());
}