Class EngineDiscoveryResult

java.lang.Object
org.junit.platform.launcher.EngineDiscoveryResult

@API(status=STABLE, since="1.10") public class EngineDiscoveryResult extends Object
EngineDiscoveryResult encapsulates the result of test discovery by a TestEngine.

A EngineDiscoveryResult consists of a mandatory Status and an optional Throwable.

Since:
1.6
  • Method Details

    • successful

      public static EngineDiscoveryResult successful()
      Create a EngineDiscoveryResult for a successful test discovery.
      Returns:
      the EngineDiscoveryResult; never null
    • failed

      public static EngineDiscoveryResult failed(Throwable throwable)
      Create a EngineDiscoveryResult for a failed test discovery.
      Parameters:
      throwable - the throwable that caused the failed discovery; may be null
      Returns:
      the EngineDiscoveryResult; never null
    • getStatus

      public EngineDiscoveryResult.Status getStatus()
      Get the status of this result.
      Returns:
      the status; never null
    • getThrowable

      public Optional<Throwable> getThrowable()
      Get the throwable that caused this result, if available.
      Returns:
      an Optional containing the throwable; never null but potentially empty
    • toString

      public String toString()
      Overrides:
      toString in class Object