Merge pull request #12894 from ulisseslima/bael-5754_convert-list-csv_quick-fix
bael-5754 - quick fix
This commit is contained in:
commit
7f3405a765
|
@ -27,15 +27,13 @@ class ListToStringUnitTest {
|
|||
List<String> arraysAsList = Arrays.asList("ONE", "TWO", "THREE");
|
||||
|
||||
StringJoiner stringJoiner = new StringJoiner(",");
|
||||
arraysAsList.stream()
|
||||
.forEach(v -> stringJoiner.add(v));
|
||||
arraysAsList.forEach(stringJoiner::add);
|
||||
String commaSeparatedString = stringJoiner.toString();
|
||||
|
||||
assertThat(commaSeparatedString).isEqualTo("ONE,TWO,THREE");
|
||||
|
||||
StringJoiner stringJoinerWithDelimiterPrefixSuffix = new StringJoiner(",", "[", "]");
|
||||
arraysAsList.stream()
|
||||
.forEach(v -> stringJoinerWithDelimiterPrefixSuffix.add(v));
|
||||
arraysAsList.forEach(stringJoinerWithDelimiterPrefixSuffix::add);
|
||||
String commaSeparatedStringWithDelimiterPrefixSuffix = stringJoinerWithDelimiterPrefixSuffix.toString();
|
||||
|
||||
assertThat(commaSeparatedStringWithDelimiterPrefixSuffix).isEqualTo("[ONE,TWO,THREE]");
|
||||
|
|
Loading…
Reference in New Issue