Class SelectorResolutionResult

java.lang.Object
org.junit.platform.engine.SelectorResolutionResult

@API(status=EXPERIMENTAL, since="1.6") public class SelectorResolutionResult extends Object
SelectorResolutionResult encapsulates the result of resolving a DiscoverySelector by a TestEngine.

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

Since:
1.6
  • Method Details

    • resolved

      public static SelectorResolutionResult resolved()
      Create a SelectorResolutionResult for a resolved selector.
      Returns:
      the SelectorResolutionResult; never null
    • unresolved

      public static SelectorResolutionResult unresolved()
      Create a SelectorResolutionResult for an unresolved selector.
      Returns:
      the SelectorResolutionResult; never null
    • failed

      public static SelectorResolutionResult failed(Throwable throwable)
      Create a SelectorResolutionResult for a failed selector resolution.
      Returns:
      the SelectorResolutionResult; never null
    • getStatus

      public SelectorResolutionResult.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