Skip to content

Commit

Permalink
Fix unmodifiableList handling of parameterized tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joyrex2001 committed Sep 28, 2022
1 parent dad17dd commit d890527
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ static List<Arguments> testDataListArguments() {
return Arrays.asList(Arguments.of(new TestData(), "foo"), Arguments.of(new TestData(), "foo"));
}

@ParameterizedTest
@MethodSource("testDataUnmodifiableListArguments")
public void methodUnmodifiableListArguments(Object list) {
}

static Stream<Arguments> testDataUnmodifiableListArguments() {
return Stream.of(Arguments.of(Collections.unmodifiableList(List.of(new TestObject3()))));
}

@ParameterizedTest
@MethodSource("testStreamOfMapEntryArguments")
public void methodList(Map.Entry<String, String> ignore) {
Expand Down Expand Up @@ -165,4 +174,10 @@ Map<String, String> getMap() {
}

}

static class TestObject3 {

static final String value = "one";

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class CustomListConverter extends CollectionConverter {
List.of().getClass().getName(),
List.of(Integer.MAX_VALUE).getClass().getName(),
Arrays.asList(Integer.MAX_VALUE).getClass().getName(),
Collections.unmodifiableList(List.of()).getClass().getName(),
Collections.emptyList().getClass().getName());

public CustomListConverter(Mapper mapper) {
Expand Down

0 comments on commit d890527

Please sign in to comment.