Class TestContextEvent
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.springframework.test.context.event.TestContextEvent
- All Implemented Interfaces:
 Serializable
- Direct Known Subclasses:
 AfterTestClassEvent,AfterTestExecutionEvent,AfterTestMethodEvent,BeforeTestClassEvent,BeforeTestExecutionEvent,BeforeTestMethodEvent,PrepareTestInstanceEvent
Base class for events published by the 
EventPublishingTestExecutionListener.- Since:
 - 5.2
 - Author:
 - Frank Scheffler, Sam Brannen
 - See Also:
 
- 
Field Summary
Fields inherited from class java.util.EventObject
source - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionfinal TestContextGet theTestContextassociated with this event.final TestContextAlias forgetSource().Methods inherited from class org.springframework.context.ApplicationEvent
getTimestampMethods inherited from class java.util.EventObject
toString 
- 
Constructor Details
- 
TestContextEvent
Create a newTestContextEvent.- Parameters:
 source- theTestContextassociated with this event (must not benull)
 
 - 
 - 
Method Details
- 
getSource
Get theTestContextassociated with this event.- Overrides:
 getSourcein classEventObject- Returns:
 - the 
TestContextassociated with this event (nevernull) - See Also:
 
 - 
getTestContext
Alias forgetSource().This method may be favored over
getSource()— for example, to improve readability in SpEL expressions for event processing conditions.- Returns:
 - the 
TestContextassociated with this event (nevernull) - See Also:
 
 
 -