Package org.junit.jupiter.params
Enum ArgumentCountValidationMode
- java.lang.Object
-
- java.lang.Enum<ArgumentCountValidationMode>
-
- org.junit.jupiter.params.ArgumentCountValidationMode
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<ArgumentCountValidationMode>
@API(status=MAINTAINED, since="5.13.3") public enum ArgumentCountValidationMode extends java.lang.Enum<ArgumentCountValidationMode>Enumeration of argument count validation modes for@ParameterizedClassand@ParameterizedTest.When an
ArgumentsSourceprovides more arguments than declared by the parameterized class or method, there might be a bug in the class/method or theArgumentsSource. By default, the additional arguments are ignored.ArgumentCountValidationModeallows you to control how additional arguments are handled.- Since:
- 5.12
- See Also:
ParameterizedClass.argumentCountValidation(),ParameterizedTest.argumentCountValidation()
-
-
Constructor Summary
Constructors Modifier Constructor Description privateArgumentCountValidationMode()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ArgumentCountValidationModevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static ArgumentCountValidationMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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 parameterized class or 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 parameterized class or method, this raises an error.
-
-
Method Detail
-
values
public static ArgumentCountValidationMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ArgumentCountValidationMode c : ArgumentCountValidationMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ArgumentCountValidationMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-