java.lang.Object
org.eclipse.microprofile.fault.tolerance.tck.util.Exceptions

public class Exceptions extends Object
Utility class, no public constructor
  • Method Details

    • expectTimeout

      public static void expectTimeout(Exceptions.ExceptionThrowingAction action)
      Run an action an check that a timeout exception is thrown
      Parameters:
      action - The action to run
    • expectTestException

      public static void expectTestException(Exceptions.ExceptionThrowingAction action)
      Run an action and check that a TestException is thrown
      Parameters:
      action - The action to run
    • expectCbOpen

      public static void expectCbOpen(Exceptions.ExceptionThrowingAction action)
      Run an action and check that a CircuitBreakerOpenException is thrown
      Parameters:
      action - The action to run
    • expectBulkheadException

      public static void expectBulkheadException(Exceptions.ExceptionThrowingAction action)
      Run an action and check that a BulkheadException is thrown
      Parameters:
      action - The action to run
    • expectBulkheadException

      public static void expectBulkheadException(Future<?> future)
      Run future.get() and check that a BulkheadException is thrown wrapped in an ExecutionException.
      Parameters:
      future - the action to run
    • expect

      public static void expect(Class<? extends Exception> expectedException, Future<?> future)
      Call future.get() and check that it throws an ExecutionException wrapping the expectedException
      Parameters:
      expectedException - the expected exception type
      future - the future to check
    • expect

      public static void expect(Class<? extends Exception> expectedException, Exceptions.ExceptionThrowingAction action)
      Run an action an ensure that the expected exception is thrown
      Parameters:
      expectedException - the exception class to expect
      action - the action to run
    • expectNoException

      public static void expectNoException(Exceptions.ExceptionThrowingAction action)
      Run an action and ensure that no exception is thrown
      Parameters:
      action - the action to run