- java.lang.Object
-
- org.junit.platform.testkit.engine.EventConditions
-
@API(status=MAINTAINED, since="1.7") public final class EventConditions extends Object
Collection of AssertJ conditions forEvent
.- Since:
- 1.4
- See Also:
TestExecutionResultConditions
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Condition<Event>
abortedWithReason(Condition<Throwable>... conditions)
static Condition<Event>
container()
static Condition<Event>
container(Class<?> clazz)
static Condition<Event>
container(String uniqueIdSubstring)
static Condition<Event>
container(Condition<Event> condition)
Create a newCondition
that matches if and only if anEvent
matches the suppliedCondition
and its test descriptor is a container.static Condition<Event>
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
.static Condition<Event>
dynamicTestRegistered(String uniqueIdSubstring)
static Condition<Event>
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
.static Condition<Event>
engine()
Create a newCondition
that matches if and only if anEvent
's test descriptor is an instance ofEngineDescriptor
.static Condition<Event>
event(Condition<? super Event>... conditions)
static Condition<Event>
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
.static Condition<Event>
finishedSuccessfully()
Create a newCondition
that matches if and only if anEvent
's type isEventType.FINISHED
and its result has a status ofSUCCESSFUL
.static Condition<Event>
finishedWithFailure()
static Condition<Event>
finishedWithFailure(Condition<Throwable>... conditions)
static Condition<Event>
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.static Condition<Event>
reason(String expectedReason)
static Condition<Event>
reason(Predicate<String> predicate)
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.static Condition<Event>
result(Condition<TestExecutionResult> condition)
Create a newCondition
that matches if and only if anEvent
's payload is an instance ofTestExecutionResult
that matches the suppliedCondition
.static Condition<Event>
skippedWithReason(String expectedReason)
static Condition<Event>
skippedWithReason(Predicate<String> predicate)
static Condition<Event>
started()
static Condition<Event>
test()
static Condition<Event>
test(String uniqueIdSubstring)
static Condition<Event>
test(String uniqueIdSubstring, String displayName)
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
.static Condition<Event>
type(EventType expectedType)
static Condition<Event>
uniqueIdSubstring(String uniqueIdSubstring)
Create a newCondition
that matches if and only if the unique id of anEvent
's test descriptor contains the suppliedString
.static Condition<Event>
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.static Condition<Event>
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 Detail
-
event
@SafeVarargs public static Condition<Event> event(Condition<? super Event>... conditions)
-
engine
public static Condition<Event> engine()
Create a newCondition
that matches if and only if anEvent
's test descriptor is an instance ofEngineDescriptor
.
-
test
public static Condition<Event> test(String uniqueIdSubstring)
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
public static Condition<Event> test(String uniqueIdSubstring, String displayName)
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
.- See Also:
test()
,uniqueIdSubstring(String)
,displayName(String)
-
container
public static Condition<Event> container(Condition<Event> condition)
Create a newCondition
that matches if and only if anEvent
matches the suppliedCondition
and its test descriptor is a container.
-
nestedContainer
public static Condition<Event> 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.Please note that this method does not differentiate between static nested classes and non-static member classes (e.g., inner classes).
-
dynamicTestRegistered
public static Condition<Event> dynamicTestRegistered(String uniqueIdSubstring)
-
dynamicTestRegistered
public static Condition<Event> 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
.
-
uniqueIdSubstring
public static Condition<Event> uniqueIdSubstring(String uniqueIdSubstring)
Create a newCondition
that matches if and only if the unique id of anEvent
's test descriptor contains the suppliedString
.
-
uniqueIdSubstrings
public static Condition<Event> 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.- Since:
- 1.6
-
uniqueIdSubstrings
public static Condition<Event> 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.- Since:
- 1.6
-
displayName
public static Condition<Event> 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
.
-
skippedWithReason
public static Condition<Event> skippedWithReason(String expectedReason)
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
public static Condition<Event> skippedWithReason(Predicate<String> predicate)
Create a newCondition
that matches if and only if anEvent
's type isEventType.SKIPPED
and the reason matches the suppliedPredicate
.- See Also:
reason(Predicate)
-
abortedWithReason
@SafeVarargs public static Condition<Event> abortedWithReason(Condition<Throwable>... conditions)
-
finishedWithFailure
@SafeVarargs public static Condition<Event> finishedWithFailure(Condition<Throwable>... conditions)
-
finishedSuccessfully
public static Condition<Event> finishedSuccessfully()
Create a newCondition
that matches if and only if anEvent
's type isEventType.FINISHED
and its result has a status ofSUCCESSFUL
.
-
finished
public static Condition<Event> 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
.
-
result
public static Condition<Event> result(Condition<TestExecutionResult> condition)
Create a newCondition
that matches if and only if anEvent
's payload is an instance ofTestExecutionResult
that matches the suppliedCondition
.
-
-