@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.
Supported types include shorts(), bytes(), ints(),
longs(), floats(), doubles(), chars(),
booleans(), strings(), and classes(). Note, however,
that only one of the supported types may be specified per
@ValueSource declaration.
The supplied literal values will be provided as arguments to the
annotated @ParameterizedTest method.
ArgumentsSource,
ParameterizedTest| Modifier and Type | Optional Element | Description |
|---|---|---|
boolean[] |
booleans |
The
boolean values to use as sources of arguments; must not be empty. |
byte[] |
bytes |
The
byte values to use as sources of arguments; must not be empty. |
char[] |
chars |
The
char values to use as sources of arguments; must not be empty. |
Class<?>[] |
classes |
The
Class values to use as sources of arguments; must not be empty. |
double[] |
doubles |
The
double values to use as sources of arguments; must not be empty. |
float[] |
floats |
The
float 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. |
short[] |
shorts |
The
short values to use as sources of arguments; must not be empty. |
String[] |
strings |
The
String values to use as sources of arguments; must not be empty. |
short[] shorts
short values to use as sources of arguments; must not be empty.byte[] bytes
byte values to use as sources of arguments; must not be empty.float[] floats
float values to use as sources of arguments; must not be empty.double[] doubles
double values to use as sources of arguments; must not be empty.char[] chars
char values to use as sources of arguments; must not be empty.boolean[] booleans
boolean values to use as sources of arguments; must not be empty.Copyright © 2019. All rights reserved.