Class CsvArgumentsProvider
java.lang.Object
org.junit.jupiter.params.provider.AnnotationBasedArgumentsProvider<CsvSource>
org.junit.jupiter.params.provider.CsvArgumentsProvider
- All Implemented Interfaces:
Consumer<CsvSource>
,ArgumentsProvider
,AnnotationConsumer<CsvSource>
- Since:
- 5.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate com.univocity.parsers.csv.CsvParser
private static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static String[]
getHeaders
(com.univocity.parsers.csv.CsvParser csvParser) (package private) static RuntimeException
handleCsvException
(Throwable throwable, Annotation annotation) parseTextBlock
(CsvSource csvSource) parseValueArray
(CsvSource csvSource) (package private) static Arguments
processCsvRecord
(Object[] csvRecord, Set<String> nullValues, boolean useHeadersInDisplayName, String[] headers) Processes custom null values, supports wrapping of column values inNamed
if necessary (for CSV header support), and returns the CSV record wrapped in anArguments
instance.provideArguments
(org.junit.jupiter.api.extension.ExtensionContext context, CsvSource csvSource) Methods inherited from class org.junit.jupiter.params.provider.AnnotationBasedArgumentsProvider
accept, provideArguments
-
Field Details
-
LINE_SEPARATOR
- See Also:
-
nullValues
-
csvParser
private com.univocity.parsers.csv.CsvParser csvParser
-
-
Constructor Details
-
CsvArgumentsProvider
CsvArgumentsProvider()
-
-
Method Details
-
provideArguments
protected Stream<? extends Arguments> provideArguments(org.junit.jupiter.api.extension.ExtensionContext context, CsvSource csvSource) Description copied from class:AnnotationBasedArgumentsProvider
Provide aStream
ofArguments
— based on metadata in the provided annotation — to be passed to a@ParameterizedTest
method.- Specified by:
provideArguments
in classAnnotationBasedArgumentsProvider<CsvSource>
- Parameters:
context
- the current extension context; nevernull
csvSource
- the annotation to process; nevernull
- Returns:
- a stream of arguments; never
null
-
parseTextBlock
-
parseValueArray
-
getHeaders
-
processCsvRecord
static Arguments processCsvRecord(Object[] csvRecord, Set<String> nullValues, boolean useHeadersInDisplayName, String[] headers) Processes custom null values, supports wrapping of column values inNamed
if necessary (for CSV header support), and returns the CSV record wrapped in anArguments
instance. -
handleCsvException
- Returns:
- this method always throws an exception and therefore never
returns anything; the return type is merely present to allow this
method to be supplied as the operand in a
throw
statement
-