Class TestExecutionResultConditions

java.lang.Object
org.junit.platform.testkit.engine.TestExecutionResultConditions

@API(status=MAINTAINED, since="1.7") public final class TestExecutionResultConditions extends Object
Collection of AssertJ conditions for TestExecutionResult.
Since:
1.4
See Also:
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static org.assertj.core.api.Condition<Throwable>
    cause(org.assertj.core.api.Condition<Throwable> condition)
     
    static org.assertj.core.api.Condition<Throwable>
    cause(org.assertj.core.api.Condition<Throwable>... conditions)
    Create a new Condition that matches if and only if a Throwable's cause matches all supplied conditions.
    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.
    static org.assertj.core.api.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.
    static org.assertj.core.api.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.
    static org.assertj.core.api.Condition<Throwable>
    message(Predicate<String> expectedMessagePredicate)
    Create a new Condition that matches if and only if a Throwable's message matches the supplied Predicate.
    private static org.assertj.core.api.Condition<Throwable>
    rootCause(org.assertj.core.api.Condition<Throwable> condition)
     
    static org.assertj.core.api.Condition<Throwable>
    rootCause(org.assertj.core.api.Condition<Throwable>... conditions)
    Create a new Condition that matches if and only if a Throwable's root cause matches all supplied conditions.
    static org.assertj.core.api.Condition<org.junit.platform.engine.TestExecutionResult>
    status(org.junit.platform.engine.TestExecutionResult.Status expectedStatus)
    Create a new Condition that matches if and only if a TestExecutionResult's status is equal to the supplied Status.
    private static org.assertj.core.api.Condition<Throwable>
    suppressed(int index, org.assertj.core.api.Condition<Throwable> condition)
     
    static org.assertj.core.api.Condition<Throwable>
    suppressed(int index, org.assertj.core.api.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 org.assertj.core.api.Condition<org.junit.platform.engine.TestExecutionResult>
    throwable(org.assertj.core.api.Condition<? super Throwable> condition)
     
    static org.assertj.core.api.Condition<org.junit.platform.engine.TestExecutionResult>
    throwable(org.assertj.core.api.Condition<Throwable>... conditions)
    Create a new Condition that matches if and only if a TestExecutionResult's throwable matches all supplied conditions.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TestExecutionResultConditions

      private TestExecutionResultConditions()
  • Method Details

    • status

      public static org.assertj.core.api.Condition<org.junit.platform.engine.TestExecutionResult> status(org.junit.platform.engine.TestExecutionResult.Status expectedStatus)
      Create a new Condition that matches if and only if a TestExecutionResult's status is equal to the supplied Status.
    • throwable

      @SafeVarargs public static org.assertj.core.api.Condition<org.junit.platform.engine.TestExecutionResult> throwable(org.assertj.core.api.Condition<Throwable>... conditions)
      Create a new Condition that matches if and only if a TestExecutionResult's throwable matches all supplied conditions.
    • cause

      @SafeVarargs public static org.assertj.core.api.Condition<Throwable> cause(org.assertj.core.api.Condition<Throwable>... conditions)
      Create a new Condition that matches if and only if a Throwable's cause matches all supplied conditions.
      See Also:
    • rootCause

      @API(status=MAINTAINED, since="1.13.3") @SafeVarargs public static org.assertj.core.api.Condition<Throwable> rootCause(org.assertj.core.api.Condition<Throwable>... conditions)
      Create a new Condition that matches if and only if a Throwable's root cause matches all supplied conditions.
      Since:
      1.11
      See Also:
    • suppressed

      @SafeVarargs public static org.assertj.core.api.Condition<Throwable> suppressed(int index, org.assertj.core.api.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.
      See Also:
    • instanceOf

      public static org.assertj.core.api.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.
    • message

      public static org.assertj.core.api.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.
    • message

      public static org.assertj.core.api.Condition<Throwable> message(Predicate<String> expectedMessagePredicate)
      Create a new Condition that matches if and only if a Throwable's message matches the supplied Predicate.
    • throwable

      private static org.assertj.core.api.Condition<org.junit.platform.engine.TestExecutionResult> throwable(org.assertj.core.api.Condition<? super Throwable> condition)
    • cause

      private static org.assertj.core.api.Condition<Throwable> cause(org.assertj.core.api.Condition<Throwable> condition)
    • rootCause

      private static org.assertj.core.api.Condition<Throwable> rootCause(org.assertj.core.api.Condition<Throwable> condition)
    • getRootCause

      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.
    • suppressed

      private static org.assertj.core.api.Condition<Throwable> suppressed(int index, org.assertj.core.api.Condition<Throwable> condition)