Top Description Constructors Methods
org.junit.platform.testkit.engine

public final Class TestExecutionResultConditions

extends Object
Class Inheritance
Annotations
@API
status:MAINTAINED
since:1.7
Static Imports
java.util.function.Predicate.isEqual, org.apiguardian.api.API.Status.MAINTAINED, org.junit.platform.commons.util.FunctionUtils.where

Collection of AssertJ conditions for TestExecutionResult.
Since
1.4
See Also
EventConditions

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Condition<Throwable>
cause(Condition<Throwable>... conditions)

Create a new Condition that matches if and only if a Throwable's cause matches all supplied conditions.

private static Condition<Throwable>
private static Throwable
getRootCause(Throwable throwable, List<Throwable> causeChain)

Get the root cause of the supplied Throwable, or the supplied Throwable if it has no cause.

public static Condition<Throwable>
instanceOf(Class<? extends Throwable> expectedType)

Create a new Condition that matches if and only if a Throwable is an instance of the supplied Class.

public static Condition<Throwable>
message(String expectedMessage)

Create a new Condition that matches if and only if a Throwable's message is equal to the supplied String.

public static Condition<Throwable>
message(Predicate<String> expectedMessagePredicate)

Create a new Condition that matches if and only if a Throwable's message matches the supplied Predicate.

public static Condition<Throwable>
rootCause(Condition<Throwable>... conditions)

Create a new Condition that matches if and only if a Throwable's root cause matches all supplied conditions.

private static Condition<Throwable>
public static Condition<TestExecutionResult>
status(TestExecutionResult.Status expectedStatus)

Create a new Condition that matches if and only if a TestExecutionResult's status is equal to the supplied Status.

public static Condition<Throwable>
suppressed(int index, Condition<Throwable>... conditions)

Create a new Condition that matches if and only if a Throwable's suppressed throwable at the supplied index matches all supplied conditions.

private static Condition<Throwable>
suppressed(int index, Condition<Throwable> condition)

public static Condition<TestExecutionResult>
throwable(Condition<Throwable>... conditions)

Create a new Condition that matches if and only if a TestExecutionResult's throwable matches all supplied conditions.

private static Condition<TestExecutionResult>
throwable(Condition<? super Throwable> condition)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

TestExecutionResultConditionsback to summary
private TestExecutionResultConditions()

Method Detail

causeback to summary
public static Condition<Throwable> cause(Condition<Throwable>... conditions)

Create a new Condition that matches if and only if a Throwable's cause matches all supplied conditions.

Annotations
@SafeVarargs
@SuppressWarnings:varargs
See Also
rootCause(Condition...), suppressed(int, Condition...)
causeback to summary
private static Condition<Throwable> cause(Condition<Throwable> condition)
getRootCauseback to summary
private static Throwable getRootCause(Throwable throwable, List<Throwable> causeChain)

Get the root cause of the supplied Throwable, or the supplied Throwable if it has no cause.

instanceOfback to summary
public static Condition<Throwable> instanceOf(Class<? extends Throwable> expectedType)

Create a new Condition that matches if and only if a Throwable is an instance of the supplied Class.

messageback to summary
public static Condition<Throwable> message(String expectedMessage)

Create a new Condition that matches if and only if a Throwable's message is equal to the supplied String.

messageback to summary
public static Condition<Throwable> message(Predicate<String> expectedMessagePredicate)

Create a new Condition that matches if and only if a Throwable's message matches the supplied Predicate.

rootCauseback to summary
public static Condition<Throwable> rootCause(Condition<Throwable>... conditions)

Create a new Condition that matches if and only if a Throwable's root cause matches all supplied conditions.

Annotations
@API
status:MAINTAINED
since:1.13.3
@SafeVarargs
@SuppressWarnings:varargs
Since
1.11
See Also
cause(Condition...), suppressed(int, Condition...)
rootCauseback to summary
private static Condition<Throwable> rootCause(Condition<Throwable> condition)
statusback to summary
public static Condition<TestExecutionResult> status(TestExecutionResult.Status expectedStatus)

Create a new Condition that matches if and only if a TestExecutionResult's status is equal to the supplied Status.

suppressedback to summary
public static Condition<Throwable> suppressed(int index, Condition<Throwable>... conditions)

Create a new Condition that matches if and only if a Throwable's suppressed throwable at the supplied index matches all supplied conditions.

Annotations
@SafeVarargs
@SuppressWarnings:varargs
See Also
cause(Condition...), rootCause(Condition...)
suppressedback to summary
private static Condition<Throwable> suppressed(int index, Condition<Throwable> condition)
throwableback to summary
public static Condition<TestExecutionResult> throwable(Condition<Throwable>... conditions)

Create a new Condition that matches if and only if a TestExecutionResult's throwable matches all supplied conditions.

Annotations
@SafeVarargs
@SuppressWarnings:varargs
throwableback to summary
private static Condition<TestExecutionResult> throwable(Condition<? super Throwable> condition)