java.lang.Object
org.junit.platform.testkit.engine.EventConditions
Collection of AssertJ conditions for
Event
.- Since:
- 1.4
- See Also:
TestExecutionResultConditions
-
Method Summary
Modifier and TypeMethodDescriptionabortedWithReason(Condition<Throwable>... conditions)
Create a newCondition
that matches if and only if anEvent
matches the suppliedCondition
and its test descriptor is a container.displayName(String displayName)
Create a newCondition
that 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 newCondition
that matches if and only if anEvent
's type isEventType.DYNAMIC_TEST_REGISTERED
and it matches the suppliedCondition
.engine()
Create a newCondition
that matches if and only if anEvent
's test descriptor is an instance ofEngineDescriptor
.finished(Condition<TestExecutionResult> resultCondition)
Create a newCondition
that matches if and only if anEvent
's type isEventType.FINISHED
and its payload is an instance ofTestExecutionResult
that matches the suppliedCondition
.Create a newCondition
that matches if and only if anEvent
's type isEventType.FINISHED
and its result has a status ofSUCCESSFUL
.finishedWithFailure(Condition<Throwable>... conditions)
nestedContainer(Class<?> clazz)
Create a newCondition
that matches if and only if anEvent
's test descriptor is a container and its unique id contains the simple names of the suppliedClass
and all of its enclosing classes.nestedContainer(Class<?> clazz, Condition<Event> condition)
Create a newCondition
that matches if and only if anEvent
matches the suppliedCondition
, its test descriptor is a container, and its unique id contains the simple names of the suppliedClass
and all of its enclosing classes.reportEntry(Map<String,String> keyValuePairs)
Create a newCondition
that matches if and only if anEvent
's payload is an instance ofReportEntry
that contains the supplied key-value pairs.result(Condition<TestExecutionResult> condition)
Create a newCondition
that matches if and only if anEvent
's payload is an instance ofTestExecutionResult
that matches the suppliedCondition
.skippedWithReason(String expectedReason)
skippedWithReason(Predicate<String> predicate)
started()
test()
Create a newCondition
that 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 newCondition
that matches if and only if anEvent
matches the suppliedCondition
and its test descriptor is a test.uniqueIdSubstring(String uniqueIdSubstring)
Create a newCondition
that matches if and only if the unique id of anEvent
's test descriptor contains the suppliedString
.uniqueIdSubstrings(String... uniqueIdSubstrings)
Create a newCondition
that 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 newCondition
that 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 newCondition
that matches if and only if anEvent
's test descriptor is an instance ofEngineDescriptor
. -
test
Create a newCondition
that matches if and only if anEvent
's test descriptor is a test and its unique id contains the suppliedString
.- See Also:
test()
,uniqueIdSubstring(String)
-
test
Create a newCondition
that 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
. -
test
@API(status=MAINTAINED, since="1.8") public static Condition<Event> test(Condition<Event> condition)Create a newCondition
that matches if and only if anEvent
matches the suppliedCondition
and 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(String)
,test(String, String)
,displayName(String)
-
test
-
container
-
container
-
container
Create a newCondition
that matches if and only if anEvent
matches the suppliedCondition
and its test descriptor is a container. -
container
-
nestedContainer
@API(status=MAINTAINED, since="1.8") public static Condition<Event> nestedContainer(Class<?> clazz, Condition<Event> condition)Create a newCondition
that matches if and only if anEvent
matches the suppliedCondition
, its test descriptor is a container, and its unique id contains the simple names of the suppliedClass
and 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(Class)
-
nestedContainer
Create a newCondition
that matches if and only if anEvent
's test descriptor is a container and its unique id contains the simple names of the suppliedClass
and 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:
nestedContainer(Class, Condition)
-
dynamicTestRegistered
-
dynamicTestRegistered
Create a newCondition
that matches if and only if anEvent
's type isEventType.DYNAMIC_TEST_REGISTERED
and it matches the suppliedCondition
. -
uniqueIdSubstring
Create a newCondition
that matches if and only if the unique id of anEvent
's test descriptor contains the suppliedString
. -
uniqueIdSubstrings
Create a newCondition
that matches if and only if the unique id of anEvent
's test descriptor contains all of the supplied strings.- Since:
- 1.6
-
uniqueIdSubstrings
Create a newCondition
that matches if and only if the unique id of anEvent
's test descriptor contains all of the supplied strings.- Since:
- 1.6
-
displayName
Create a newCondition
that matches if and only if the display name of anEvent
's test descriptor is equal to the suppliedString
. -
skippedWithReason
Create a newCondition
that matches if and only if anEvent
's type isEventType.SKIPPED
and the reason is equal to the suppliedString
.- See Also:
reason(String)
-
skippedWithReason
Create a newCondition
that matches if and only if anEvent
's type isEventType.SKIPPED
and the reason matches the suppliedPredicate
.- See Also:
reason(Predicate)
-
started
-
abortedWithReason
-
finishedWithFailure
@SafeVarargs public static Condition<Event> finishedWithFailure(Condition<Throwable>... conditions) -
finishedWithFailure
-
finishedSuccessfully
Create a newCondition
that matches if and only if anEvent
's type isEventType.FINISHED
and its result has a status ofSUCCESSFUL
. -
finished
Create a newCondition
that matches if and only if anEvent
's type isEventType.FINISHED
and its payload is an instance ofTestExecutionResult
that matches the suppliedCondition
. -
type
-
result
Create a newCondition
that matches if and only if anEvent
's payload is an instance ofTestExecutionResult
that matches the suppliedCondition
. -
reason
-
reason
-
reportEntry
@API(status=EXPERIMENTAL, since="1.7") public static Condition<Event> reportEntry(Map<String,String> keyValuePairs)Create a newCondition
that matches if and only if anEvent
's payload is an instance ofReportEntry
that contains the supplied key-value pairs.
-