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.CsvParserprivate 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 RuntimeExceptionhandleCsvException(Throwable throwable, Annotation annotation) parseTextBlock(CsvSource csvSource) parseValueArray(CsvSource csvSource) (package private) static ArgumentsprocessCsvRecord(Object[] csvRecord, Set<String> nullValues, boolean useHeadersInDisplayName, String[] headers) Processes custom null values, supports wrapping of column values inNamedif necessary (for CSV header support), and returns the CSV record wrapped in anArgumentsinstance.provideArguments(ParameterDeclarations parameters, org.junit.jupiter.api.extension.ExtensionContext context, CsvSource csvSource) The returnedStreamwill beproperly closedby the default implementation ofAnnotationBasedArgumentsProvider.provideArguments(ParameterDeclarations, ExtensionContext), making it safe to use a resource such asFiles.lines().Methods inherited from class AnnotationBasedArgumentsProvider
accept, provideArguments, provideArgumentsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ArgumentsProvider
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(ParameterDeclarations parameters, org.junit.jupiter.api.extension.ExtensionContext context, CsvSource csvSource) 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<CsvSource>
-
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 inNamedif necessary (for CSV header support), and returns the CSV record wrapped in anArgumentsinstance. -
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
throwstatement
-