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

pack-priv Class FieldArgumentsProvider

extends AnnotationBasedArgumentsProvider<FieldSource>
Class Inheritance
Static Imports
java.util.Arrays.stream

ArgumentsProvider for @FieldSource.
Since
5.11

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static Field
findField(Class<?> testClass, String fieldName)

private static boolean
isConvertibleToStream(Field field, Object value)

Determine if the supplied value can be converted into a Stream or if the declared type of the supplied field is a Supplier of a type that can be converted into a Stream.

protected Stream<? extends Arguments>
provideArguments(ParameterDeclarations parameters, ExtensionContext context, FieldSource fieldSource)

Overrides org.junit.jupiter.params.provider.AnnotationBasedArgumentsProvider.provideArguments.

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().

private static Object
readField(Field field, @Nullable Object testInstance)

private static Field
validateField(Field field, @Nullable Object testInstance)

Inherited from org.junit.jupiter.params.provider.AnnotationBasedArgumentsProvider:
acceptprovideArgumentsprovideArguments

Constructor Detail

FieldArgumentsProviderback to summary
pack-priv FieldArgumentsProvider()

Method Detail

findFieldback to summary
pack-priv static Field findField(Class<?> testClass, String fieldName)
isConvertibleToStreamback to summary
private static boolean isConvertibleToStream(Field field, Object value)

Determine if the supplied value can be converted into a Stream or if the declared type of the supplied field is a Supplier of a type that can be converted into a Stream.

provideArgumentsback to summary
protected Stream<? extends Arguments> provideArguments(ParameterDeclarations parameters, ExtensionContext context, FieldSource fieldSource)

Overrides org.junit.jupiter.params.provider.AnnotationBasedArgumentsProvider.provideArguments.

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

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().

Annotations
@Override
readFieldback to summary
private static Object readField(Field field, @Nullable Object testInstance)
validateFieldback to summary
private static Field validateField(Field field, @Nullable Object testInstance)