Top Description Fields Constructors Methods
org.junit.jupiter.params.provider

public abstract Class AnnotationBasedArgumentsProvider<A extends Annotation>

extends Object
implements ArgumentsProvider, AnnotationConsumer<A extends Annotation>
Class Inheritance
All Implemented Interfaces
org.junit.jupiter.params.support.AnnotationConsumer, java.util.function.Consumer, org.junit.jupiter.params.provider.ArgumentsProvider
Known Direct Subclasses
org.junit.jupiter.params.provider.CsvArgumentsProvider, org.junit.jupiter.params.provider.CsvFileArgumentsProvider, org.junit.jupiter.params.provider.EnumArgumentsProvider, org.junit.jupiter.params.provider.FieldArgumentsProvider, org.junit.jupiter.params.provider.MethodArgumentsProvider, org.junit.jupiter.params.provider.ValueArgumentsProvider
Annotations
@API
status:MAINTAINED
since:5.13.3
Static Imports
org.apiguardian.api.API.Status.DEPRECATED, .API.Status.MAINTAINED

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
org.junit.jupiter.params.ParameterizedClass, org.junit.jupiter.params.ParameterizedTest, org.junit.jupiter.params.provider.ArgumentsSource, org.junit.jupiter.params.provider.Arguments, org.junit.jupiter.params.provider.ArgumentsProvider, org.junit.jupiter.params.support.AnnotationConsumer

Field Summary

Modifier and TypeField and Description
private final List<A>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final void
accept(A annotation)

Implements java.util.function.Consumer.accept.

Performs this operation on the given argument.

public Stream<? extends Arguments>
provideArguments(ParameterDeclarations parameters, ExtensionContext context)

Overrides default org.junit.jupiter.params.provider.ArgumentsProvider.provideArguments.

Provide a Stream of Arguments to be passed to a @ParameterizedClass or @ParameterizedTest.

protected Stream<? extends Arguments>

Returns:

a stream of arguments; never null
provideArguments
(ExtensionContext
the current extension context; never null
context
,
A
the annotation to process; never null
annotation
)
Deprecated since 5.13. Please implement provideArguments(ParameterDeclarations, ExtensionContext, Annotation) instead.

Provide a Stream of Arguments — based on metadata in the provided annotation — to be passed to a @ParameterizedTest method.

protected Stream<? extends Arguments>
provideArguments(ParameterDeclarations parameters, ExtensionContext context, A annotation)

The returned Stream will be properly closed by the default implementation of provideArguments(ParameterDeclarations, ExtensionContext), making it safe to use a resource such as Files.lines().

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

annotationsback to summary
private final List<A> annotations

Constructor Detail

AnnotationBasedArgumentsProviderback to summary
public AnnotationBasedArgumentsProvider()

Method Detail

acceptback to summary
public final void accept(A annotation)

Implements java.util.function.Consumer.accept.

Doc from java.util.function.Consumer.accept.

Performs this operation on the given argument.

Annotations
@Override
provideArgumentsback to summary
public Stream<? extends Arguments> provideArguments(ParameterDeclarations parameters, ExtensionContext context)

Overrides default org.junit.jupiter.params.provider.ArgumentsProvider.provideArguments.

Doc from org.junit.jupiter.params.provider.ArgumentsProvider.provideArguments.

Provide a Stream of Arguments to be passed to a @ParameterizedClass or @ParameterizedTest.

Annotations
@Override
provideArgumentsback to summary
protected Stream<? extends Arguments> provideArguments(ExtensionContext context, A annotation)

Deprecated

since 5.13.

Please implement provideArguments(ParameterDeclarations, ExtensionContext, Annotation) instead.

Provide a Stream of Arguments — based on metadata in the provided annotation — to be passed to a @ParameterizedTest method.

Parameters
context:ExtensionContext

the current extension context; never null

annotation:A

the annotation to process; never null

Returns:Stream<? extends Arguments>

a stream of arguments; never null

Annotations
@Deprecated
since:5.13
@API
status:DEPRECATED
since:5.13
provideArgumentsback to summary
protected Stream<? extends Arguments> provideArguments(ParameterDeclarations parameters, ExtensionContext context, A annotation)

The returned Stream will be properly closed by the default implementation of provideArguments(ParameterDeclarations, ExtensionContext), making it safe to use a resource such as Files.lines().