Module org.junit.jupiter.params
Annotation Type 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 anArgumentsSource
which provides access to an array of literal values.Supported types include
shorts()
,bytes()
,ints()
,longs()
,floats()
,doubles()
,chars()
,booleans()
,strings()
, andclasses()
. 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:
ArgumentsSource
,ParameterizedTest
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean[]
booleans
Theboolean
values to use as sources of arguments; must not be empty.byte[]
bytes
Thebyte
values to use as sources of arguments; must not be empty.char[]
chars
Thechar
values to use as sources of arguments; must not be empty.Class<?>[]
classes
TheClass
values to use as sources of arguments; must not be empty.double[]
doubles
Thedouble
values to use as sources of arguments; must not be empty.float[]
floats
Thefloat
values to use as sources of arguments; must not be empty.int[]
ints
Theint
values to use as sources of arguments; must not be empty.long[]
longs
Thelong
values to use as sources of arguments; must not be empty.short[]
shorts
Theshort
values to use as sources of arguments; must not be empty.String[]
strings
TheString
values to use as sources of arguments; must not be empty.
-