Annotation Type Parameter


  • @Retention(RUNTIME)
    @Target({FIELD,PARAMETER})
    public @interface Parameter
    Fields or step parameters can be annotated with Parameter. Parameters are injected by tapir at Test execution runtime. There are several ways how to provide the data:
    1. unparameterized @Parameter: You have to implement a method which's name is derived from the field / parameter name in the test class which returns the parameter
    2. value() or method(): You have to implement a method with the given name in the test class which returns the parameter
    3. providerClass(): The given providerClass has to provide a method which returns the parameter. The method name can be derived from the field / parameter name or explicitly specified by using value()/method().
    If a test class or step should be executed multiple times based on the parameter value, please consult IteratedParameter.
    Since:
    2.0.0
    Author:
    Nils Christian Ehmke <[email protected]>, Oliver Libutzki <[email protected]>
    See Also:
    IteratedParameter
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String method
      An alias for value().
      java.lang.Class<?> providerClass
      The name of the class which includes the method defined as value() or method().
      java.lang.String value
      The name of the method which provides the parameter.
    • Element Detail

      • value

        java.lang.String value
        The name of the method which provides the parameter.
        Returns:
        the name of the method which provides the parameter
        Since:
        2.0.0
        Default:
        ""
      • method

        java.lang.String method
        An alias for value(). If both attributes are set, value() is preferred.
        Returns:
        the name of the method which provides the parameter
        Since:
        2.0.0
        Default:
        ""
      • providerClass

        java.lang.Class<?> providerClass
        The name of the class which includes the method defined as value() or method(). If the annotated method is located in the same class this parameter can be omitted.
        Returns:
        the provider class
        Since:
        2.0.0
        Default:
        java.lang.Void.class