In this lesson, we take a look at
@ParameterizedTest data generated from comma-separated values (CSV). There are two source annotations to help with this integration:
@CsvSource allows you to specify the values right in the annotation, in a well-arranged structure.
@CsvFileSource expects a path to a resource file, which is read in at runtime, and should contain the desired input values. This makes it possible to store test data outside of the source code itself!
- CSV data can be inlined with
- ...or read in from a resource file with