Skip to content

Commit

Permalink
Expand tests for array to Collection/Set/List interface
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Jul 5, 2023
1 parent b76664e commit b7b9f2c
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,18 @@ void characterToNumber() {

@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"));
}
Expand Down

0 comments on commit b7b9f2c

Please sign in to comment.