Enum Class ArgumentCountValidationMode

java.lang.Object
java.lang.Enum<ArgumentCountValidationMode>
org.junit.jupiter.params.ArgumentCountValidationMode
All Implemented Interfaces:
Serializable, Comparable<ArgumentCountValidationMode>, Constable

@API(status=EXPERIMENTAL, since="5.12") public enum ArgumentCountValidationMode extends Enum<ArgumentCountValidationMode>
Enumeration of argument count validation modes for @ParameterizedTest.

When an ArgumentsSource provides more arguments than declared by the test method, there might be a bug in the test method or the ArgumentsSource. By default, the additional arguments are ignored. ArgumentCountValidationMode allows you to control how additional arguments are handled.

Since:
5.12
See Also:
  • Enum Constant Details

    • DEFAULT

      public static final ArgumentCountValidationMode DEFAULT
      Use the default validation mode.

      The default validation mode may be changed via the "junit.jupiter.params.argumentCountValidation" configuration parameter (see the User Guide for details on configuration parameters).

    • NONE

      public static final ArgumentCountValidationMode NONE
      Use the "none" argument count validation mode.

      When there are more arguments provided than declared by the test method, these additional arguments are ignored.

    • STRICT

      public static final ArgumentCountValidationMode STRICT
      Use the strict argument count validation mode.

      When there are more arguments provided than declared by the test method, this raises an error.

  • Method Details

    • values

      public static ArgumentCountValidationMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ArgumentCountValidationMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null