Package org.elasticsearch.test
Class CheckedFunctionUtils
java.lang.Object
org.elasticsearch.test.CheckedFunctionUtils
Test utilities for working with
CheckedFunction
s and CheckedSupplier
s.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T, R, E extends Exception>
org.elasticsearch.core.CheckedFunction<T,R,E>Returns a Mockito matcher for any argument that is anCheckedFunction
.static <R, E extends Exception>
org.elasticsearch.common.CheckedSupplier<R,E>Returns a Mockito matcher for any argument that is anCheckedSupplier
.
-
Constructor Details
-
CheckedFunctionUtils
public CheckedFunctionUtils()
-
-
Method Details
-
anyCheckedFunction
public static <T, R, E extends Exception> org.elasticsearch.core.CheckedFunction<T,R,E> anyCheckedFunction()Returns a Mockito matcher for any argument that is anCheckedFunction
.- Type Parameters:
T
- the function input type that the caller expects. Do not specify this, it will be inferredR
- the function output type that the caller expects. Do not specify this, it will be inferredE
- the function exception type that the caller expects. Do not specify this, it will be inferred- Returns:
- a checked function matcher
-
anyCheckedSupplier
public static <R, E extends Exception> org.elasticsearch.common.CheckedSupplier<R,E> anyCheckedSupplier()Returns a Mockito matcher for any argument that is anCheckedSupplier
.- Type Parameters:
R
- the supplier output type that the caller expects. Do not specify this, it will be inferredE
- the supplier exception type that the caller expects. Do not specify this, it will be inferred- Returns:
- a checked supplier matcher
-