Annotation Type Conditional


  • @Retention(RUNTIME)
    @Target({TYPE,METHOD})
    public @interface Conditional
    Test classes, test suites and test steps can be annotated with Conditional. 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. conditionalClass(): 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().
    Since:
    2.0.0
    Author:
    Nils Christian Ehmke <[email protected]>, Oliver Libutzki <[email protected]>
    See Also:
    ConditionalFilter
    • Optional Element Summary

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

      • value

        java.lang.String value
        The name of the method which checks the condition.
        Returns:
        the name of the method which checks the condition
        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 checks the condition
        Since:
        2.0.0
        Default:
        ""
      • conditionalClass

        java.lang.Class<?> conditionalClass
        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 conditional class
        Since:
        2.0.0
        Default:
        java.lang.Void.class