Annotation Type CartesianTest.Enum

Enclosing class:
CartesianTest

Parameter annotation to be used with CartesianTest for providing enum values.
Since:
1.5.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Enumeration of modes for selecting enum constants by name.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The enum constant selection mode.
    The names of enum constants to provide, or regular expressions to select the names of enum constants to provide.
    Class<? extends Enum<?>>
    The enum type that serves as the source of the enum constants.
  • Element Details

    • value

      Class<? extends Enum<?>> value
      The enum type that serves as the source of the enum constants.

      If this attribute is not set explicitly, the declared type of the parameter of the @CartesianProductTest method, which has the same relative index of the annotation, is used.

      For example, in case of the following test:

      @CartesianProductTest
      @CartesianTest.Enum
      @CartesianTest.Enum
      void multipleOmittedTypes(FirstEnum e1, SecondEnum e2) {
              ...
      }
      
      the first @CartesianTest.Enum annotation will provide all the values of FirstEnum, while the second annotation will provide all the values of SecondEnum.
      See Also:
      Default:
      org.junitpioneer.jupiter.cartesian.CartesianEnumArgumentsProvider.NullEnum.class
    • names

      String[] names
      The names of enum constants to provide, or regular expressions to select the names of enum constants to provide.

      If no names or regular expressions are specified, all enum constants declared in the specified enum type will be provided.

      The mode() determines how the names are interpreted.

      See Also:
      Default:
      {}
    • mode