Class FieldArgumentsProvider
- java.lang.Object
-
- org.junit.jupiter.params.provider.AnnotationBasedArgumentsProvider<FieldSource>
-
- org.junit.jupiter.params.provider.FieldArgumentsProvider
-
- All Implemented Interfaces:
java.util.function.Consumer<FieldSource>,ArgumentsProvider,AnnotationConsumer<FieldSource>
class FieldArgumentsProvider extends AnnotationBasedArgumentsProvider<FieldSource>
- Since:
- 5.11
-
-
Constructor Summary
Constructors Constructor Description FieldArgumentsProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static java.lang.reflect.FieldfindField(java.lang.Class<?> testClass, java.lang.String fieldName)private static booleanisConvertibleToStream(java.lang.reflect.Field field, java.lang.Object value)Determine if the supplied value can be converted into aStreamor if the declared type of the supplied field is aSupplierof a type that can be converted into aStream.protected java.util.stream.Stream<? extends Arguments>provideArguments(ParameterDeclarations parameters, org.junit.jupiter.api.extension.ExtensionContext context, FieldSource fieldSource)The returnedStreamwill beproperly closedby the default implementation ofAnnotationBasedArgumentsProvider.provideArguments(ParameterDeclarations, ExtensionContext), making it safe to use a resource such asFiles.lines().private static java.lang.ObjectreadField(java.lang.reflect.Field field, java.lang.Object testInstance)private static java.lang.reflect.FieldvalidateField(java.lang.reflect.Field field, java.lang.Object testInstance)-
Methods inherited from class org.junit.jupiter.params.provider.AnnotationBasedArgumentsProvider
accept, provideArguments, provideArguments
-
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
-
-
-
-
Method Detail
-
provideArguments
protected java.util.stream.Stream<? extends Arguments> provideArguments(ParameterDeclarations parameters, org.junit.jupiter.api.extension.ExtensionContext context, FieldSource fieldSource)
Description copied from class:AnnotationBasedArgumentsProviderThe returnedStreamwill beproperly closedby the default implementation ofAnnotationBasedArgumentsProvider.provideArguments(ParameterDeclarations, ExtensionContext), making it safe to use a resource such asFiles.lines().- Overrides:
provideArgumentsin classAnnotationBasedArgumentsProvider<FieldSource>
-
findField
static java.lang.reflect.Field findField(java.lang.Class<?> testClass, java.lang.String fieldName)
-
validateField
private static java.lang.reflect.Field validateField(java.lang.reflect.Field field, java.lang.Object testInstance)
-
readField
private static java.lang.Object readField(java.lang.reflect.Field field, java.lang.Object testInstance)
-
isConvertibleToStream
private static boolean isConvertibleToStream(java.lang.reflect.Field field, java.lang.Object value)Determine if the supplied value can be converted into aStreamor if the declared type of the supplied field is aSupplierof a type that can be converted into aStream.
-
-