Module org.junit.jupiter.params
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
provideArguments
(ExtensionContext context, A annotation) Deprecated.provideArguments
(ParameterDeclarations parameters, ExtensionContext context) provideArguments
(ParameterDeclarations parameters, ExtensionContext context, A annotation) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.junit.jupiter.params.provider.ArgumentsProvider
provideArguments
-
Constructor Details
-
AnnotationBasedArgumentsProvider
public AnnotationBasedArgumentsProvider()
-
-
Method Details
-
accept
- Specified by:
accept
in interfaceConsumer<A extends Annotation>
-
provideArguments
public Stream<? extends Arguments> provideArguments(ParameterDeclarations parameters, ExtensionContext context) Description copied from interface:ArgumentsProvider
- Specified by:
provideArguments
in interfaceArgumentsProvider
- Parameters:
parameters
- the parameter declarations for the parameterized class or test; nevernull
context
- the current extension context; nevernull
- Returns:
- a stream of arguments; never
null
-
provideArguments
@Deprecated protected Stream<? extends Arguments> provideArguments(ExtensionContext context, A annotation) Deprecated.Please implementprovideArguments(ParameterDeclarations, ExtensionContext, Annotation)
instead.Provide aStream
ofArguments
— based on metadata in the provided annotation — to be passed to a@ParameterizedTest
method.- Parameters:
context
- the current extension context; nevernull
annotation
- the annotation to process; nevernull
- Returns:
- a stream of arguments; never
null
-
provideArguments
protected Stream<? extends Arguments> provideArguments(ParameterDeclarations parameters, ExtensionContext context, A annotation)
-
provideArguments(ParameterDeclarations, ExtensionContext, Annotation)
instead.