Module org.junit.jupiter.params
Annotation Type EnumSource
-
@Target({ANNOTATION_TYPE,METHOD}) @Retention(RUNTIME) @Documented @API(status=EXPERIMENTAL, since="5.0") @ArgumentsSource(org.junit.jupiter.params.provider.EnumArgumentsProvider.class) public @interface EnumSource
@EnumSourceis anArgumentsSourcefor constants of a anEnum.The enum constants will be provided as arguments to the annotated
@ParameterizedTestmethod.The enum type can be specified explicitly using the
value()attribute. Otherwise, the declared type of the first parameter of the@ParameterizedTestmethod is used.The set of enum constants can be restricted via the
names()andmode()attributes.- Since:
- 5.0
- See Also:
ArgumentsSource,ParameterizedTest
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description EnumSource.ModemodeThe enum constant selection mode.String[]namesThe names of enum constants to provide, or regular expressions to select the names of enum constants to provide.Class<? extends Enum<?>>valueThe enum type that serves as the source of the enum constants.
-
-
-
-
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.- Default:
- {}
-
-
-
mode
EnumSource.Mode mode
The enum constant selection mode.Defaults to
INCLUDE.- See Also:
EnumSource.Mode.INCLUDE,EnumSource.Mode.EXCLUDE,EnumSource.Mode.MATCH_ALL,EnumSource.Mode.MATCH_ANY,names()
- Default:
- org.junit.jupiter.params.provider.EnumSource.Mode.INCLUDE
-
-