Interface ActualException<T extends Throwable>

Type Parameters:
T - the type of the expected exception
All Superinterfaces:
Actual, ActualObject<T>

public interface ActualException<T extends Throwable> extends ActualObject<T>

A type representing the expected exceptional behavior in a test.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Function<String,String>
    A function enclosing an already enclosed type with default text.

    Fields inherited from interface org.tudalgo.algoutils.tutor.general.assertions.actual.Actual

    BRACKET_FORMATTER
  • Method Summary

    Modifier and Type
    Method
    Description
    default T
    Returns the exception thrown in the test.
    static <T extends Throwable>
    ActualException<T>
    of(T exception, boolean successful)
    Returns an instance representing behavior where the given exception was thrown or an behavior where no exception was thrown if no exception is given.
    static <T extends Throwable>
    ActualException<T>
    of(T exception, boolean successful, Function<String,String> formatter)
    Returns an instance representing behavior where the given exception was thrown or, if no exception is given, an behavior where no exception was thrown.

    Methods inherited from interface org.tudalgo.algoutils.tutor.general.assertions.actual.Actual

    display, string, successful

    Methods inherited from interface org.tudalgo.algoutils.tutor.general.assertions.actual.ActualObject

    behavior, object
  • Field Details

    • DEFAULT_FORMATTER

      static final Function<String,String> DEFAULT_FORMATTER
      A function enclosing an already enclosed type with default text.
  • Method Details

    • of

      static <T extends Throwable> ActualException<T> of(T exception, boolean successful, Function<String,String> formatter)

      Returns an instance representing behavior where the given exception was thrown or, if no exception is given, an behavior where no exception was thrown.

      Type Parameters:
      T - the type of the exception
      Parameters:
      exception - the exception
      formatter - the formatter
      Returns:
      the exceptional behavior
    • of

      static <T extends Throwable> ActualException<T> of(T exception, boolean successful)

      Returns an instance representing behavior where the given exception was thrown or an behavior where no exception was thrown if no exception is given.

      Type Parameters:
      T - the type of the exception
      Parameters:
      exception - the exception
      Returns:
      the exceptional behavior
    • exception

      default T exception()
      Returns the exception thrown in the test.
      Returns:
      the exception