Class CheckedFunctionUtils

java.lang.Object
org.elasticsearch.test.CheckedFunctionUtils

public class CheckedFunctionUtils extends Object
Test utilities for working with CheckedFunctions and CheckedSuppliers.
  • 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 an CheckedFunction.
      Type Parameters:
      T - the function input type that the caller expects. Do not specify this, it will be inferred
      R - the function output type that the caller expects. Do not specify this, it will be inferred
      E - 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> CheckedSupplier<R,E> anyCheckedSupplier()
      Returns a Mockito matcher for any argument that is an CheckedSupplier.
      Type Parameters:
      R - the supplier output type that the caller expects. Do not specify this, it will be inferred
      E - the supplier exception type that the caller expects. Do not specify this, it will be inferred
      Returns:
      a checked supplier matcher