Annotation Interface EnumSource


@Target({ANNOTATION_TYPE,METHOD}) @Retention(RUNTIME) @Documented @API(status=STABLE, since="5.7") @ArgumentsSource(org.junit.jupiter.params.provider.EnumArgumentsProvider.class) public @interface EnumSource
@EnumSource is an ArgumentsSource for constants of a an Enum.

The enum constants will be provided as arguments to the annotated @ParameterizedTest method.

The enum type can be specified explicitly using the value() attribute. Otherwise, the declared type of the first parameter of the @ParameterizedTest method is used.

The set of enum constants can be restricted via the names() and mode() attributes.

Since:
5.0
See Also:
ArgumentsSource, ParameterizedTest
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    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.