@Target({ANNOTATION_TYPE,METHOD}) @Retention(RUNTIME) @Documented @API(status=EXPERIMENTAL, since="5.0") @ArgumentsSource(org.junit.jupiter.params.provider.ValueArgumentsProvider.class) public @interface ValueSource
@ValueSource
is an ArgumentsSource
which provides
access to an array of literal values of primitive types.
Supported primitive types include strings()
, ints()
,
longs()
, and doubles()
. You must not specify more than one
annotation attribute.
The supplied literal values will be provided as arguments to the
annotated @ParameterizedTest
method.
ArgumentsSource
,
ParameterizedTest
Modifier and Type | Optional Element | Description |
---|---|---|
double[] |
doubles |
The
double values to use as sources of arguments; must not be
empty. |
int[] |
ints |
The
int values to use as sources of arguments; must not be empty. |
long[] |
longs |
The
long values to use as sources of arguments; must not be empty. |
java.lang.String[] |
strings |
The
String values to use as sources of arguments; must not be
empty. |