Top Description Methods
org.junit.jupiter.params.provider

public @Interface ValueSource

extends Annotation
Annotations
@Target:ANNOTATION_TYPE, METHOD, TYPE
@Retention:RUNTIME
@Documented
@Inherited
@Repeatable:ValueSources
@API
status:STABLE
since:5.7
@ArgumentsSource:ValueArgumentsProvider
@SuppressWarnings:exports
Static Imports
org.apiguardian.api.API.Status.STABLE

@ValueSource is a repeatable 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 @ParameterizedClass or @ParameterizedTest.

Inheritance

This annotation is inherited to subclasses.

Since
5.0
See Also
org.junit.jupiter.params.provider.ArgumentsSource, org.junit.jupiter.params.ParameterizedClass, org.junit.jupiter.params.ParameterizedTest

Method Summary

Modifier and TypeMethod and Description
public boolean[]
booleans()

The boolean values to use as sources of arguments; must not be empty.

public byte[]
bytes()

The byte values to use as sources of arguments; must not be empty.

public char[]
chars()

The char values to use as sources of arguments; must not be empty.

public Class<?>[]
classes()

The Class values to use as sources of arguments; must not be empty.

public double[]
doubles()

The double values to use as sources of arguments; must not be empty.

public float[]
floats()

The float values to use as sources of arguments; must not be empty.

public int[]
ints()

The int values to use as sources of arguments; must not be empty.

public long[]
longs()

The long values to use as sources of arguments; must not be empty.

public short[]
shorts()

The short values to use as sources of arguments; must not be empty.

public String[]
strings()

The String values to use as sources of arguments; must not be empty.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

booleansback to summary
public boolean[] booleans()

The boolean values to use as sources of arguments; must not be empty.

Since
5.5
bytesback to summary
public byte[] bytes()

The byte values to use as sources of arguments; must not be empty.

Since
5.1
charsback to summary
public char[] chars()

The char values to use as sources of arguments; must not be empty.

Since
5.1
classesback to summary
public Class<?>[] classes()

The Class values to use as sources of arguments; must not be empty.

Since
5.1
doublesback to summary
public double[] doubles()

The double values to use as sources of arguments; must not be empty.

floatsback to summary
public float[] floats()

The float values to use as sources of arguments; must not be empty.

Since
5.1
intsback to summary
public int[] ints()

The int values to use as sources of arguments; must not be empty.

longsback to summary
public long[] longs()

The long values to use as sources of arguments; must not be empty.

shortsback to summary
public short[] shorts()

The short values to use as sources of arguments; must not be empty.

Since
5.1
stringsback to summary
public String[] strings()

The String values to use as sources of arguments; must not be empty.