Class EventConditions
java.lang.Object
org.junit.platform.testkit.engine.EventConditions
Collection of AssertJ conditions for
Event
.- Since:
- 1.4
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.assertj.core.api.Condition
<Event> abortedWithReason
(org.assertj.core.api.Condition<Throwable>... conditions) static org.assertj.core.api.Condition
<Event> static org.assertj.core.api.Condition
<Event> Create a newCondition
that matches if and only if anEvent
's test descriptor is a container and its unique id contains the fully-qualified name of the suppliedClass
.static org.assertj.core.api.Condition
<Event> Create a newCondition
that matches if and only if anEvent
's test descriptor is a container and its unique id contains the suppliedString
.static org.assertj.core.api.Condition
<Event> Create a newCondition
that matches if and only if anEvent
matches the suppliedCondition
and its test descriptor is a container.static org.assertj.core.api.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 org.assertj.core.api.Condition
<Event> dynamicTestRegistered
(String uniqueIdSubstring) Create a newCondition
that matches if and only if anEvent
's type isEventType.DYNAMIC_TEST_REGISTERED
and its unique id contains the suppliedString
.static org.assertj.core.api.Condition
<Event> dynamicTestRegistered
(org.assertj.core.api.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 org.assertj.core.api.Condition
<Event> engine()
Create a newCondition
that matches if and only if anEvent
's test descriptor is an instance ofEngineDescriptor
.static org.assertj.core.api.Condition
<Event> Create a newCondition
that matches if and only if anEvent
matches all of the supplied conditions.static org.assertj.core.api.Condition
<Event> finished
(org.assertj.core.api.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 org.assertj.core.api.Condition
<Event> Create a newCondition
that matches if and only if anEvent
's type isEventType.FINISHED
and its result has a status ofSUCCESSFUL
.private static org.assertj.core.api.Condition
<Event> finishedWithCause
(TestExecutionResult.Status expectedStatus, org.assertj.core.api.Condition<Throwable>... conditions) static org.assertj.core.api.Condition
<Event> static org.assertj.core.api.Condition
<Event> finishedWithFailure
(org.assertj.core.api.Condition<Throwable>... conditions) static org.assertj.core.api.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 org.assertj.core.api.Condition
<Event> nestedContainer
(Class<?> clazz, org.assertj.core.api.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.static org.assertj.core.api.Condition
<Event> static org.assertj.core.api.Condition
<Event> static org.assertj.core.api.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 org.assertj.core.api.Condition
<Event> result
(org.assertj.core.api.Condition<TestExecutionResult> condition) Create a newCondition
that matches if and only if anEvent
's payload is an instance ofTestExecutionResult
that matches the suppliedCondition
.static org.assertj.core.api.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
.static org.assertj.core.api.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
.static org.assertj.core.api.Condition
<Event> started()
static org.assertj.core.api.Condition
<Event> test()
static org.assertj.core.api.Condition
<Event> Create a newCondition
that matches if and only if anEvent
's test descriptor is a test and its unique id contains the suppliedString
.static org.assertj.core.api.Condition
<Event> 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 org.assertj.core.api.Condition
<Event> Create a newCondition
that matches if and only if anEvent
matches the suppliedCondition
and its test descriptor is a test.static org.assertj.core.api.Condition
<Event> static org.assertj.core.api.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 org.assertj.core.api.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 org.assertj.core.api.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.
-
Constructor Details
-
EventConditions
private EventConditions()
-
-
Method Details
-
event
@SafeVarargs public static org.assertj.core.api.Condition<Event> event(org.assertj.core.api.Condition<? super Event>... conditions) Create a newCondition
that matches if and only if anEvent
matches all of the supplied conditions. -
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
public static org.assertj.core.api.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
@API(status=MAINTAINED, since="1.8") public static org.assertj.core.api.Condition<Event> test(org.assertj.core.api.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
-
container
Create a newCondition
that matches if and only if anEvent
's test descriptor is a container and its unique id contains the fully-qualified name of the suppliedClass
. -
container
Create a newCondition
that matches if and only if anEvent
's test descriptor is a container and its unique id contains the suppliedString
. -
container
public static org.assertj.core.api.Condition<Event> container(org.assertj.core.api.Condition<Event> condition) 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 org.assertj.core.api.Condition<Event> nestedContainer(Class<?> clazz, org.assertj.core.api.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
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:
-
dynamicTestRegistered
Create a newCondition
that matches if and only if anEvent
's type isEventType.DYNAMIC_TEST_REGISTERED
and its unique id contains the suppliedString
. -
dynamicTestRegistered
public static org.assertj.core.api.Condition<Event> dynamicTestRegistered(org.assertj.core.api.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
Create a newCondition
that matches if and only if the unique id of anEvent
's test descriptor contains the suppliedString
. -
uniqueIdSubstrings
public static org.assertj.core.api.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 org.assertj.core.api.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
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:
-
skippedWithReason
Create a newCondition
that matches if and only if anEvent
's type isEventType.SKIPPED
and the reason matches the suppliedPredicate
.- See Also:
-
started
-
abortedWithReason
@SafeVarargs public static org.assertj.core.api.Condition<Event> abortedWithReason(org.assertj.core.api.Condition<Throwable>... conditions) -
finishedWithFailure
@SafeVarargs public static org.assertj.core.api.Condition<Event> finishedWithFailure(org.assertj.core.api.Condition<Throwable>... conditions) -
finishedWithCause
private static org.assertj.core.api.Condition<Event> finishedWithCause(TestExecutionResult.Status expectedStatus, org.assertj.core.api.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
public static org.assertj.core.api.Condition<Event> finished(org.assertj.core.api.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
. -
type
-
result
public static org.assertj.core.api.Condition<Event> result(org.assertj.core.api.Condition<TestExecutionResult> condition) 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=STABLE, since="1.10") public static org.assertj.core.api.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.
-