Package de.bmiag.tapir.execution.plan
Class ParameterProviderInvocation
- java.lang.Object
-
- de.bmiag.tapir.execution.plan.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 byParameter
orIteratedParameter
. 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]>
-
-
Constructor Summary
Constructors Constructor Description ParameterProviderInvocation()
-
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)
-
-
-
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 parameterreturnType
- The expected return typetestClass
- 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 fieldreturnType
- The expected return typetestClass
- 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)
-
-