Class AnnotationBasedArgumentsProvider<A extends Annotation>

java.lang.Object
org.junit.jupiter.params.provider.AnnotationBasedArgumentsProvider<A>
All Implemented Interfaces:
Consumer<A>, ArgumentsProvider, AnnotationConsumer<A>

@API(status=EXPERIMENTAL, since="5.10") public abstract class AnnotationBasedArgumentsProvider<A extends Annotation> extends Object implements ArgumentsProvider, AnnotationConsumer<A>
AnnotationBasedArgumentsProvider is an abstract base class for ArgumentsProvider implementations that also need to consume an annotation in order to provide the arguments.
Since:
5.10
See Also:
  • Constructor Details

    • AnnotationBasedArgumentsProvider

      public AnnotationBasedArgumentsProvider()
  • Method Details

    • accept

      public final void accept(A annotation)
      Specified by:
      accept in interface Consumer<A extends Annotation>
    • provideArguments

      public final Stream<? extends Arguments> provideArguments(ExtensionContext context)
      Description copied from interface: ArgumentsProvider
      Provide a Stream of Arguments to be passed to a @ParameterizedTest method.
      Specified by:
      provideArguments in interface ArgumentsProvider
      Parameters:
      context - the current extension context; never null
      Returns:
      a stream of arguments; never null
    • provideArguments

      protected abstract Stream<? extends Arguments> provideArguments(ExtensionContext context, A annotation)
      Provide a Stream of Arguments — based on metadata in the provided annotation — to be passed to a @ParameterizedTest method.
      Parameters:
      context - the current extension context; never null
      annotation - the annotation to process; never null
      Returns:
      a stream of arguments; never null