mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-23 22:59:03 +00:00
Expand tests for array to Collection/Set/List interface
See gh-28048
This commit is contained in:
+12
@@ -342,6 +342,18 @@ class DefaultConversionServiceTests {
|
||||
|
||||
@Test
|
||||
void convertArrayToCollectionInterface() {
|
||||
Collection<?> result = conversionService.convert(new String[] {"1", "2", "3"}, Collection.class);
|
||||
assertThat(result).isEqualTo(Set.of("1", "2", "3"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void convertArrayToSetInterface() {
|
||||
Collection<?> result = conversionService.convert(new String[] {"1", "2", "3"}, Set.class);
|
||||
assertThat(result).isEqualTo(Set.of("1", "2", "3"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void convertArrayToListInterface() {
|
||||
List<?> result = conversionService.convert(new String[] {"1", "2", "3"}, List.class);
|
||||
assertThat(result).isEqualTo(List.of("1", "2", "3"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user