Junit 5 – How to pass in multiple null values for @CsvSource?

@CsvSource has an attribute called nullValues.
See the documentation.

A list of strings that should be interpreted as null references.

@CsvSource(value= {"null, null",
                   "foo, bar"}
           , nullValues={"null"})

The other option is to simply don’t pass any value as stated in the previously linked documentation.

Please note that unquoted empty values will always be converted to null references regardless of the value of this nullValues attribute; whereas, a quoted empty string will be treated as an emptyValue().

@CsvSource({",",
            "foo, bar"})

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)