Module org.junit.jupiter.params
Annotation Interface ValueSource
@Target({ANNOTATION_TYPE,METHOD})
@Retention(RUNTIME)
@Documented
@API(status=STABLE,
since="5.7")
@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.
- Since:
- 5.0
- See Also:
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean[]
Theboolean
values to use as sources of arguments; must not be empty.byte[]
Thebyte
values to use as sources of arguments; must not be empty.char[]
Thechar
values to use as sources of arguments; must not be empty.Class<?>[]
TheClass
values to use as sources of arguments; must not be empty.double[]
Thedouble
values to use as sources of arguments; must not be empty.float[]
Thefloat
values to use as sources of arguments; must not be empty.int[]
Theint
values to use as sources of arguments; must not be empty.long[]
Thelong
values to use as sources of arguments; must not be empty.short[]
Theshort
values to use as sources of arguments; must not be empty.String[]
TheString
values to use as sources of arguments; must not be empty.
-
Element Details
-
shorts
short[] shortsTheshort
values to use as sources of arguments; must not be empty.- Since:
- 5.1
- Default:
- {}
-
bytes
byte[] bytesThebyte
values to use as sources of arguments; must not be empty.- Since:
- 5.1
- Default:
- {}
-
ints
int[] intsTheint
values to use as sources of arguments; must not be empty.- Default:
- {}
-
longs
long[] longsThelong
values to use as sources of arguments; must not be empty.- Default:
- {}
-
floats
float[] floatsThefloat
values to use as sources of arguments; must not be empty.- Since:
- 5.1
- Default:
- {}
-
doubles
double[] doublesThedouble
values to use as sources of arguments; must not be empty.- Default:
- {}
-
chars
char[] charsThechar
values to use as sources of arguments; must not be empty.- Since:
- 5.1
- Default:
- {}
-
booleans
boolean[] booleansTheboolean
values to use as sources of arguments; must not be empty.- Since:
- 5.5
- Default:
- {}
-
strings
String[] stringsTheString
values to use as sources of arguments; must not be empty.- Default:
- {}
-
classes
Class<?>[] classesTheClass
values to use as sources of arguments; must not be empty.- Since:
- 5.1
- Default:
- {}
-