public class Exceptions extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
Exceptions.ExceptionThrowingAction |
Modifier and Type | Method and Description |
---|---|
static void |
expect(Class<? extends Exception> expectedException,
Exceptions.ExceptionThrowingAction action)
Run an action an ensure that the expected exception is thrown
|
static void |
expect(Class<? extends Exception> expectedException,
Future<?> future)
Call
future.get() and check that it throws an ExecutionException wrapping the expectedException |
static void |
expectBulkheadException(Exceptions.ExceptionThrowingAction action)
Run an action and check that a
BulkheadException is thrown |
static void |
expectBulkheadException(Future<?> future)
|
static void |
expectCbOpen(Exceptions.ExceptionThrowingAction action)
Run an action and check that a
CircuitBreakerOpenException is thrown |
static void |
expectNoException(Exceptions.ExceptionThrowingAction action)
Run an action and ensure that no exception is thrown
|
static void |
expectTestException(Exceptions.ExceptionThrowingAction action)
Run an action and check that a
TestException is thrown |
static void |
expectTimeout(Exceptions.ExceptionThrowingAction action)
Run an action an check that a timeout exception is thrown
|
public static void expectTimeout(Exceptions.ExceptionThrowingAction action)
action
- The action to runpublic static void expectTestException(Exceptions.ExceptionThrowingAction action)
TestException
is thrownaction
- The action to runpublic static void expectCbOpen(Exceptions.ExceptionThrowingAction action)
CircuitBreakerOpenException
is thrownaction
- The action to runpublic static void expectBulkheadException(Exceptions.ExceptionThrowingAction action)
BulkheadException
is thrownaction
- The action to runpublic static void expectBulkheadException(Future<?> future)
future
- the action to runpublic static void expect(Class<? extends Exception> expectedException, Future<?> future)
future.get()
and check that it throws an ExecutionException wrapping the expectedException
expectedException
- the expected exception typefuture
- the future to checkpublic static void expect(Class<? extends Exception> expectedException, Exceptions.ExceptionThrowingAction action)
expectedException
- the exception class to expectaction
- the action to runpublic static void expectNoException(Exceptions.ExceptionThrowingAction action)
action
- the action to runCopyright © 2016 – 2021 Eclipse Foundation. All rights reserved.
Use is subject to license terms.