JUnit 5 - Convert multiple CSV file parameters into single object
JUnit 5 - Convert multiple CSV file parameters into single object Hello there Java testers. I started working with JUnit 5 a few days ago because I loved the new way of creating parameterized tests. There's the @ParameterizedTest that allows a test to run in a parameterized fashion and @CsvFileSource that loads the parameters from a CSV file. @ParameterizedTest @CsvFileSource The thing is that I have too much columns in my CSV and don't want to have a huge method signature in my unit test. Let me give you an example: @ParameterizedTest @CsvFileSource(resources = "/test-data.csv") void myTest(String p1, String p2, String p3, String p4, String p5, String p6) { //test using parameters } I'd like to know if there's some kind of converter that can do something like this for me: @ParameterizedTest @CsvFileSource(resources = "/test-data.csv") void myTest(@ConvertWith(TestDataConverter.class) TestData testData) { //test using parameters } static cl...