Class EventConditions
java.lang.Object
org.junit.platform.testkit.engine.EventConditions
Collection of AssertJ conditions for
Event.- Since:
- 1.4
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionabortedWithReason(Condition<Throwable>... conditions) Create a newConditionthat matches if and only if anEventmatches the suppliedConditionand its test descriptor is a container.displayName(String displayName) Create a newConditionthat matches if and only if the display name of anEvent's test descriptor is equal to the suppliedString.dynamicTestRegistered(String uniqueIdSubstring) dynamicTestRegistered(Condition<Event> condition) Create a newConditionthat matches if and only if anEvent's type isEventType.DYNAMIC_TEST_REGISTEREDand it matches the suppliedCondition.engine()Create a newConditionthat matches if and only if anEvent's test descriptor is an instance ofEngineDescriptor.finished(Condition<TestExecutionResult> resultCondition) Create a newConditionthat matches if and only if anEvent's type isEventType.FINISHEDand its payload is an instance ofTestExecutionResultthat matches the suppliedCondition.Create a newConditionthat matches if and only if anEvent's type isEventType.FINISHEDand its result has a status ofSUCCESSFUL.finishedWithFailure(Condition<Throwable>... conditions) legacyReportingName(String legacyReportingName) Create a newConditionthat matches if and only if the TestDescriptor.getLegacyReportingName() () legacy reporting name} of anEvent's test descriptor is equal to the suppliedString.nestedContainer(Class<?> clazz) Create a newConditionthat matches if and only if anEvent's test descriptor is a container and its unique id contains the simple names of the suppliedClassand all of its enclosing classes.nestedContainer(Class<?> clazz, Condition<Event> condition) Create a newConditionthat matches if and only if anEventmatches the suppliedCondition, its test descriptor is a container, and its unique id contains the simple names of the suppliedClassand all of its enclosing classes.reportEntry(Map<String, String> keyValuePairs) Create a newConditionthat matches if and only if anEvent's payload is an instance ofReportEntrythat contains the supplied key-value pairs.result(Condition<TestExecutionResult> condition) Create a newConditionthat matches if and only if anEvent's payload is an instance ofTestExecutionResultthat matches the suppliedCondition.skippedWithReason(String expectedReason) skippedWithReason(Predicate<String> predicate) started()test()Create a newConditionthat matches if and only if anEvent's test descriptor is a test, its unique id contains the suppliedString, and its display name equals the suppliedString.Create a newConditionthat matches if and only if anEventmatches the suppliedConditionand its test descriptor is a test.Create a newConditionthat matches if and only if the unique id of anEvent's test descriptor matches the suppliedCondition.Create a newConditionthat matches if and only if the unique id of anEvent's test descriptor is equal to the suppliedUniqueId.uniqueIdSubstring(String uniqueIdSubstring) Create a newConditionthat matches if and only if the unique id of anEvent's test descriptor contains the suppliedString.uniqueIdSubstrings(String... uniqueIdSubstrings) Create a newConditionthat matches if and only if the unique id of anEvent's test descriptor contains all of the supplied strings.uniqueIdSubstrings(List<String> uniqueIdSubstrings) Create a newConditionthat matches if and only if the unique id of anEvent's test descriptor contains all of the supplied strings.
-
Method Details
-
event
-
engine
Create a newConditionthat matches if and only if anEvent's test descriptor is an instance ofEngineDescriptor. -
test
-
test
-
test
@API(status=MAINTAINED, since="1.8") public static Condition<Event> test(Condition<Event> condition) Create a newConditionthat matches if and only if anEventmatches the suppliedConditionand its test descriptor is a test.For example,
test(displayName("my display name"))can be used to match against a test with the given display name.- Since:
- 1.8
- See Also:
-
test
-
container
-
container
-
container
-
container
-
nestedContainer
@API(status=MAINTAINED, since="1.8") public static Condition<Event> nestedContainer(Class<?> clazz, Condition<Event> condition) Create a newConditionthat matches if and only if anEventmatches the suppliedCondition, its test descriptor is a container, and its unique id contains the simple names of the suppliedClassand all of its enclosing classes.For example,
nestedContainer(MyNestedTests.class, displayName("my display name"))can be used to match against a nested container with the given display name.Please note that this method does not differentiate between static nested classes and non-static member classes (e.g., inner classes).
- Since:
- 1.8
- See Also:
-
nestedContainer
Create a newConditionthat matches if and only if anEvent's test descriptor is a container and its unique id contains the simple names of the suppliedClassand all of its enclosing classes.Please note that this method does not differentiate between static nested classes and non-static member classes (e.g., inner classes).
- See Also:
-
dynamicTestRegistered
-
dynamicTestRegistered
-
uniqueId
-
uniqueId
-
uniqueIdSubstring
-
uniqueId
-
uniqueIdSubstrings
-
uniqueIdSubstrings
-
displayName
Create a newConditionthat matches if and only if the display name of anEvent's test descriptor is equal to the suppliedString. -
legacyReportingName
@API(status=EXPERIMENTAL, since="6.0") public static Condition<Event> legacyReportingName(String legacyReportingName) Create a newConditionthat matches if and only if the TestDescriptor.getLegacyReportingName() () legacy reporting name} of anEvent's test descriptor is equal to the suppliedString.- Since:
- 1.13
-
skippedWithReason
-
skippedWithReason
-
started
-
abortedWithReason
-
finishedWithFailure
-
finishedWithFailure
-
finishedSuccessfully
Create a newConditionthat matches if and only if anEvent's type isEventType.FINISHEDand its result has a status ofSUCCESSFUL. -
finished
Create a newConditionthat matches if and only if anEvent's type isEventType.FINISHEDand its payload is an instance ofTestExecutionResultthat matches the suppliedCondition. -
type
-
result
Create a newConditionthat matches if and only if anEvent's payload is an instance ofTestExecutionResultthat matches the suppliedCondition. -
reason
-
reason
-
reportEntry
-
fileEntry
-