|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2022 the original author or authors. |
| 2 | + * Copyright 2002-2023 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -342,10 +342,20 @@ void characterToNumber() {
|
342 | 342 |
|
343 | 343 | @Test
|
344 | 344 | void convertArrayToCollectionInterface() {
|
| 345 | + Collection<?> result = conversionService.convert(new String[] {"1", "2", "3"}, Collection.class); |
| 346 | + assertThat(result).isEqualTo(new LinkedHashSet<>(Arrays.asList("1", "2", "3"))); |
| 347 | + } |
| 348 | + |
| 349 | + @Test |
| 350 | + void convertArrayToSetInterface() { |
| 351 | + Collection<?> result = conversionService.convert(new String[] {"1", "2", "3"}, Set.class); |
| 352 | + assertThat(result).isEqualTo(new LinkedHashSet<>(Arrays.asList("1", "2", "3"))); |
| 353 | + } |
| 354 | + |
| 355 | + @Test |
| 356 | + void convertArrayToListInterface() { |
345 | 357 | List<?> result = conversionService.convert(new String[] {"1", "2", "3"}, List.class);
|
346 |
| - assertThat(result.get(0)).isEqualTo("1"); |
347 |
| - assertThat(result.get(1)).isEqualTo("2"); |
348 |
| - assertThat(result.get(2)).isEqualTo("3"); |
| 358 | + assertThat(result).isEqualTo(Arrays.asList("1", "2", "3")); |
349 | 359 | }
|
350 | 360 |
|
351 | 361 | @Test
|
|
0 commit comments