Arguments is an abstraction that provides access to an array of
objects to be used for invoking a @ParameterizedTest method.
A java. of such Arguments will
typically be provided by an ArgumentsProvider.
API Note
This interface is specifically designed as a simple holder of arguments for a parameterized test. Therefore, if you end up transforming or filtering the arguments, you should consider using one of the following in intermediate steps:
Alternatively, you can use an
ArgumentConverter
to convert some of the arguments from one type to another.
ArgumentSet, org.junit.jupiter.params.ParameterizedTest , org.junit.jupiter.params.provider.ArgumentsSource , org.junit.jupiter.params.provider.ArgumentsProvider , org.junit.jupiter.params.converter.ArgumentConverter
| Modifier and Type | Class and Description |
|---|---|
| public static class | Arguments.
Specialization of |
| Modifier and Type | Method and Description |
|---|---|
| public static Arguments | |
| public static Arguments. | Returns: anArgumentSet; never nullthe name of the argument set; must not be name, @Nullable Object... null or blankthe arguments to be used for an invocation of the test
method; must not be arguments)null but may contain nullFactory method for creating an |
| public @Nullable Object[] | Returns: the arguments; nevernull but may contain nullGet the arguments used for an invocation of the
|
| public static Arguments |
| arguments | back to summary |
|---|---|
| public static Arguments arguments(@Nullable Object... arguments) Factory method for creating an instance of This method is an alias for
| |
| argumentSet | back to summary |
|---|---|
| public static Arguments. Factory method for creating an Favor this method over This method is well suited to be used as a static import — for
example, via:
| |
| get | back to summary |
|---|---|
| public @Nullable Object[] get() Get the arguments used for an invocation of the
API Note If you need a type-safe way to access some or all of the arguments, please read the class-level API note. | |
| of | back to summary |
|---|---|
| public static Arguments of(@Nullable Object... arguments) Factory method for creating an instance of
| |
Arguments#argumentSet(String, Object...) , org.junit.jupiter.params.ParameterizedTest#ARGUMENT_SET_NAME_PLACEHOLDER , org.junit.jupiter.params.ParameterizedTest#ARGUMENT_SET_NAME_OR_ARGUMENTS_WITH_NAMES_PLACEHOLDER
| Modifier and Type | Field and Description |
|---|---|
| private final @Nullable Object[] | |
| private final String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public @Nullable Object[] | get()
Implements org. Get the arguments used for an invocation of the
|
| public String | Returns: the name of thisArgumentSet; never null or blankGet the name of this |
| public String | Returns: the name of thisArgumentSetOverrides java. Return the |
| arguments | back to summary |
|---|---|
| private final @Nullable Object[] arguments | |
| name | back to summary |
|---|---|
| private final String name | |
| ArgumentSet | back to summary |
|---|---|
| private ArgumentSet(String name, @Nullable Object[] arguments) | |
| get | back to summary |
|---|---|
| public @Nullable Object[] get() Implements org. Doc from org. Get the arguments used for an invocation of the
| |
| getName | back to summary |
|---|---|
| public String getName() Get the name of this
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Return the | |