Event represents a single event fired during execution of
a test plan on the JUnit Platform.
EventType
| Modifier and Type | Field and Description |
|---|---|
| private final @Nullable Object | |
| private final TestDescriptor | |
| private final Instant | |
| private final EventType |
| Access | Constructor and Description |
|---|---|
| private | Event(EventType
the type of the event; never type, TestDescriptor nullthe testDescriptor, @Nullable Object TestDescriptor associated with the event;
never nullthe generic payload associated with the event; may be payload)nullConstruct an |
| Modifier and Type | Method and Description |
|---|---|
| public static <T> Predicate | Returns: the resultingPredicatethe required payload type payloadType, Predicate<? super T> a payloadPredicate)Predicate to match against payloadsCreate a |
| public static Predicate | Returns: the resultingPredicatea testDescriptorPredicate)Predicate to match against test
descriptorsCreate a |
| public static Predicate | Returns: the resultingPredicatethe type to match against type)Create a |
| public static Event | Returns: the newly createdEventthe testDescriptor)TestDescriptor associated with the event;
never nullCreate an |
| public static Event | Returns: the newly createdEventthe testDescriptor, TestExecutionResult TestDescriptor associated with the event;
never nullthe result)TestExecutionResult for the supplied
TestDescriptor; never nullCreate a finished |
| public static Event | Returns: the newly createdEventthe testDescriptor, @Nullable String TestDescriptor associated with the event;
never nullthe reason the execution was skipped; may be reason)nullCreate a skipped |
| public static Event | Returns: the newly createdEventthe testDescriptor)TestDescriptor associated with the event;
never nullCreate a started |
| public static Event | Returns: the newly createdEventthe testDescriptor, FileEntry TestDescriptor associated with the event;
never nullthe file)FileEntry that was published; never nullCreate an |
| public Optional | Returns: anOptional containing the payload; never null
but potentially emptyGet the payload, if available. |
| public <T> Optional | Returns: anOptional containing the payload; never null
but potentially emptythe expected payload type; never payloadType)nullGet the payload of the expected type, if available. |
| public <T> T | Returns: the payloadthe required payload type; never payloadType)nullGet the payload of the required type. |
| public TestDescriptor | Returns: theTestDescriptor; never nullGet the |
| public Instant | Returns: theInstant when this Event occurred;
never nullGet the |
| public EventType | |
| public static Event | Returns: the newly createdEventthe testDescriptor, ReportEntry TestDescriptor associated with the event;
never nullthe entry)ReportEntry that was published; never nullCreate an |
| public String |
| payload | back to summary |
|---|---|
| private final @Nullable Object payload | |
| testDescriptor | back to summary |
|---|---|
| private final TestDescriptor testDescriptor | |
| timestamp | back to summary |
|---|---|
| private final Instant timestamp | |
| type | back to summary |
|---|---|
| private final EventType type | |
| Event | back to summary |
|---|---|
| private Event(EventType type, TestDescriptor testDescriptor, @Nullable Object payload) Construct an
| |
| byPayload | back to summary |
|---|---|
| public static <T> Predicate Create a | |
| byTestDescriptor | back to summary |
|---|---|
| public static Predicate Create a
| |
| byType | back to summary |
|---|---|
| public static Predicate Create a | |
| dynamicTestRegistered | back to summary |
|---|---|
| public static Event dynamicTestRegistered(TestDescriptor testDescriptor) Create an
| |
| executionFinished | back to summary |
|---|---|
| public static Event executionFinished(TestDescriptor testDescriptor, TestExecutionResult result) Create a finished
| |
| executionSkipped | back to summary |
|---|---|
| public static Event executionSkipped(TestDescriptor testDescriptor, @Nullable String reason) Create a skipped
| |
| executionStarted | back to summary |
|---|---|
| public static Event executionStarted(TestDescriptor testDescriptor) Create a started
| |
| fileEntryPublished | back to summary |
|---|---|
| public static Event fileEntryPublished(TestDescriptor testDescriptor, FileEntry file) Create an
| |
| getPayload | back to summary |
|---|---|
| public Optional Get the payload, if available.
| |
| getPayload | back to summary |
|---|---|
| public <T> Optional Get the payload of the expected type, if available. This is a convenience method that automatically casts the payload to
the expected type. If the payload is not present or is not of the expected
type, this method will return
| |
| getRequiredPayload | back to summary |
|---|---|
| public <T> T getRequiredPayload(Class<T> payloadType) throws IllegalArgumentException Get the payload of the required type. This is a convenience method that automatically casts the payload to
the required type. If the payload is not present or is not of the expected
type, this method will throw an
| |
| getTestDescriptor | back to summary |
|---|---|
| public TestDescriptor getTestDescriptor() Get the
| |
| getTimestamp | back to summary |
|---|---|
| public Instant getTimestamp() Get the
| |
| getType | back to summary |
|---|---|
| public EventType getType() Get the type of this | |
| reportingEntryPublished | back to summary |
|---|---|
| public static Event reportingEntryPublished(TestDescriptor testDescriptor, ReportEntry entry) Create an
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |