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 EventObject
source -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal testContextGet thetestContextassociated with this event.final testContextAlias forgetSource().Methods inherited from class ApplicationEvent
getTimestampMethods inherited from class 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:
-