Annotation Type ParameterizedTest



  • @Target({ANNOTATION_TYPE,METHOD})
    @Retention(RUNTIME)
    @Documented
    @API(status=EXPERIMENTAL,
         since="5.0")
    @TestTemplate
    @ExtendWith(org.junit.jupiter.params.ParameterizedTestExtension.class)
    public @interface ParameterizedTest
    @ParameterizedTest is used to signal that the annotated method is a parameterized test method.

    @ParameterizedTest methods must specify at least one ArgumentsProvider via the @ArgumentsSource or a corresponding composed annotation. The provider is responsible for providing a Stream of Arguments that will be used to invoke the @ParameterizedTest method. The method may have additional parameters to be resolved by other ParameterResolvers at the end of the method's parameter list.

    Method parameters may use @ConvertWith or a corresponding composed annotation to specify an explicit ArgumentConverter.

    @ParameterizedTest may also be used as a meta-annotation in order to create a custom composed annotation that inherits the semantics of @ParameterizedTest.

    @ParameterizedTest methods must not be private or static.

    Since:
    5.0
    See Also:
    ArgumentsSource, CsvFileSource, CsvSource, EnumSource, MethodSource, ValueSource, ConvertWith
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String name
      The name pattern to be used for invocations of the parameterized test; never blank or consisting solely of whitespace.
    • Element Detail

      • name

        java.lang.String name
        The name pattern to be used for invocations of the parameterized test; never blank or consisting solely of whitespace.

        You may use the following placeholders:

        • {index}: the current invocation index (1-based)
        • {arguments}: the complete, comma-separated arguments list
        • {0}, {1}, etc.: an individual argument

        For the latter, you may use MessageFormat patterns to customize formatting of values.

        See Also:
        MessageFormat
        Default:
        "[{index}] {arguments}"