A new @Elements composed annotation could be added to convert collection-like strings to JDK types, e.g., arrays, List, Iterable, Collection, Set, Map, etc. Their Sequenced variants should also be supported.
The underlying JUnit conversion capabilities could serve as a delegate for converting each element.
The converter should support common string representations, like:
Array / List / Collection / Iterable
- JSON-style:
[1, 2, 3]
- CSV-style like
1, 2, 3 (would likely not work when used in combination with @CsvSource, but maybe that use case could be supported with a configurable delimiter, e.g., 1; 2; 3 , 1|2|3)
Set
- Curly braces:
{1, 2, 3}
- Square brackets:
[1, 2, 3]
A new
@Elementscomposed annotation could be added to convert collection-like strings to JDK types, e.g., arrays,List,Iterable,Collection,Set,Map, etc. TheirSequencedvariants should also be supported.The underlying JUnit conversion capabilities could serve as a delegate for converting each element.
The converter should support common string representations, like:
Array / List / Collection / Iterable
[1, 2, 3]1, 2, 3(would likely not work when used in combination with@CsvSource, but maybe that use case could be supported with a configurable delimiter, e.g.,1; 2; 3,1|2|3)Set
{1, 2, 3}[1, 2, 3]