Interface TryExecutionResult


@API(status=MAINTAINED, since="1.4.0") public interface TryExecutionResult
Represents the result of calling a property method with a list of parameters.
  • Method Details

    • satisfied

      static TryExecutionResult satisfied()
      Create a result that satisfies the current property with the current parameter set. All remaining tries to be executed.
      Returns:
      result instance
    • satisfied

      static TryExecutionResult satisfied(boolean shouldPropertyFinishEarly)
      Create a result that satisfies the current property and will immediately finish this property as successful.
      Returns:
      result instance
    • falsified

      static TryExecutionResult falsified(@Nullable Throwable throwable)
      Create a result that falsified the current property and will immediately finish this property as failed.
      Parameters:
      throwable - The throwable to describe the reason of falsification
      Returns:
      result instance
    • invalid

      static TryExecutionResult invalid(@Nullable Throwable throwable)
      Create a result that calls out the current parameter list as invalid. All remaining tries will be executed.
      Parameters:
      throwable - A (potentially null) exception. Usually of type TestAbortedException.
      Returns:
      result instance
    • invalid

      static TryExecutionResult invalid()
      Create a result that calls out the current parameter list as invalid. All remaining tries will be executed.
      Returns:
      result instance
    • isSatisfied

      default boolean isSatisfied()
      Returns:
      true if status is satisfied
    • isFalsified

      default boolean isFalsified()
      Returns:
      true if status is falsified
    • isInvalid

      default boolean isInvalid()
      Returns:
      true if status is invalid
    • footnotes

      @API(status=MAINTAINED, since="1.5.5") default List<String> footnotes()
      List of footnotes to be added to failure report
      Returns:
      list of Strings
    • withFootnotes

      @API(status=MAINTAINED, since="1.5.5") default TryExecutionResult withFootnotes(Collection<String> otherFootnotes)
      Add one or more footnotes to be added to failure report
      Parameters:
      otherFootnotes - a list of footnotes to add
    • status

      Returns:
      Status enum
    • throwable

      Optional<Throwable> throwable()
      Will return Optional.empty() if status is anything but TryExecutionResult.Status.FALSIFIED.
      Returns:
      instance of Throwable or subtype
    • shouldPropertyFinishEarly

      boolean shouldPropertyFinishEarly()
      Returns:
      true if status is satisfied and remaining tries shall be skipped