public class MockException extends Object
| 构造器和说明 |
|---|
MockException() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <E extends Exception> |
period(Object key,
int period,
E exception) |
static <E extends Exception> |
period(Object key,
int period,
java.util.function.Supplier<E> exceptionFactory)
Mock exception happens by period
|
static <E extends Exception> |
possible(double possible,
E exception) |
static <E extends Exception> |
possible(double possible,
java.util.function.Supplier<E> exceptionFactory)
Mock exception happens by possibility
|
public static <E extends Exception> void period(Object key, int period, E exception) throws E extends Exception
E extends Exceptionpublic static <E extends Exception> void period(Object key, int period, java.util.function.Supplier<E> exceptionFactory) throws E extends Exception
key - the unique key to decide these invocation are groupedperiod - how many invocations will occur an exceptionexceptionFactory - exception to throwE - exception typeE extends Exceptionpublic static <E extends Exception> void possible(double possible, E exception) throws E extends Exception
E extends Exceptionpublic static <E extends Exception> void possible(double possible, java.util.function.Supplier<E> exceptionFactory) throws E extends Exception
possible - exceptionFactory - EE extends ExceptionCopyright © 2017. All rights reserved.