Interface Arguments

All Known Implementing Classes:
Arguments.ArgumentSet

@API(status=STABLE, since="5.7") public interface Arguments
Arguments is an abstraction that provides access to an array of objects to be used for invoking a @ParameterizedTest method.

A Stream of such Arguments will typically be provided by an ArgumentsProvider.

Since:
5.0
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    Specialization of Arguments that associates a name with a set of arguments.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Arguments
    arguments(Object... arguments)
    Factory method for creating an instance of Arguments based on the supplied arguments.
    argumentSet(String name, Object... arguments)
    Factory method for creating an Arguments.ArgumentSet based on the supplied name and arguments.
    get()
    Get the arguments used for an invocation of the @ParameterizedTest method.
    static Arguments
    of(Object... arguments)
    Factory method for creating an instance of Arguments based on the supplied arguments.
  • Method Details

    • get

      Object[] get()
      Get the arguments used for an invocation of the @ParameterizedTest method.
      Returns:
      the arguments; never null
    • of

      static Arguments of(Object... arguments)
      Factory method for creating an instance of Arguments based on the supplied arguments.
      Parameters:
      arguments - the arguments to be used for an invocation of the test method; must not be null
      Returns:
      an instance of Arguments; never null
      See Also:
    • arguments

      static Arguments arguments(Object... arguments)
      Factory method for creating an instance of Arguments based on the supplied arguments.

      This method is an alias for of(Object...) and is intended to be used when statically imported — for example, via: import static org.junit.jupiter.params.provider.Arguments.arguments;

      Parameters:
      arguments - the arguments to be used for an invocation of the test method; must not be null
      Returns:
      an instance of Arguments; never null
      Since:
      5.3
      See Also:
    • argumentSet

      @API(status=MAINTAINED, since="5.13.3") static Arguments.ArgumentSet argumentSet(String name, Object... arguments)
      Factory method for creating an Arguments.ArgumentSet based on the supplied name and arguments.

      Favor this method over Arguments.of(...) and arguments(...) when you wish to assign a name to the entire set of arguments.

      This method is well suited to be used as a static import — for example, via: import static org.junit.jupiter.params.provider.Arguments.argumentSet;.

      Parameters:
      name - the name of the argument set; must not be null or blank
      arguments - the arguments to be used for an invocation of the test method; must not be null
      Returns:
      an ArgumentSet; never null
      Since:
      5.11
      See Also: