Class ParameterProviderInvocation


  • @Component("parameterProviderInvocation")
    public class ParameterProviderInvocation
    extends java.lang.Object
    Responsible for providing the concrete value of a field or step parameter which is annotated by Parameter or IteratedParameter. It does so by calling the underlying data provider which might be the test class itself or an external provider class.
    Since:
    2.0.0
    Author:
    Oliver Libutzki <[email protected]>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> T invoke​(java.lang.reflect.Field field, java.lang.Class<T> returnType, java.lang.Object testClass)
      Invokes the provider method for the given field and returns an instance of the given returnType.
      <T> T invoke​(java.lang.reflect.Parameter parameter, java.lang.Class<T> returnType, java.lang.Object testClass)
      Invokes the provider method for the given parameter and returns an instance of the given returnType.
      protected <T> T invokeInternal​(java.lang.reflect.AnnotatedElement annotatedElement, java.lang.Class<T> returnType, java.lang.Object testClass)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ParameterProviderInvocation

        public ParameterProviderInvocation()
    • Method Detail

      • invoke

        public <T> T invoke​(java.lang.reflect.Parameter parameter,
                            java.lang.Class<T> returnType,
                            java.lang.Object testClass)
        Invokes the provider method for the given parameter and returns an instance of the given returnType.
        Type Parameters:
        T - return type of the provider method
        Parameters:
        parameter - The step parameter
        returnType - The expected return type
        testClass - The current test class instance
        Returns:
        the result of the data provider invocation
        Since:
        2.0.0
      • invoke

        public <T> T invoke​(java.lang.reflect.Field field,
                            java.lang.Class<T> returnType,
                            java.lang.Object testClass)
        Invokes the provider method for the given field and returns an instance of the given returnType.
        Type Parameters:
        T - return type of the provider method
        Parameters:
        field - The test class field
        returnType - The expected return type
        testClass - The current test class instance
        Returns:
        the result of the data provider invocation
        Since:
        2.0.0
      • invokeInternal

        protected <T> T invokeInternal​(java.lang.reflect.AnnotatedElement annotatedElement,
                                       java.lang.Class<T> returnType,
                                       java.lang.Object testClass)