diff --git a/integration-tests/test-extension/tests/src/test/java/io/quarkus/it/extension/ParamsTest.java b/integration-tests/test-extension/tests/src/test/java/io/quarkus/it/extension/ParamsTest.java index b211657c3838f..42c1949b690c2 100644 --- a/integration-tests/test-extension/tests/src/test/java/io/quarkus/it/extension/ParamsTest.java +++ b/integration-tests/test-extension/tests/src/test/java/io/quarkus/it/extension/ParamsTest.java @@ -133,4 +133,36 @@ static Stream> testStreamOfMapEntryArguments() { static class TestData { final List foo = Arrays.asList("one", "two", "three"); } + + static Stream arguments() { + return Stream.of( + Arguments.of(new TestObject1()), + Arguments.of(new TestObject2())); + } + + @ParameterizedTest + @MethodSource("arguments") + void map(Object o) { + + } + + static class TestObject1 { + + private final Map map = Collections.emptyMap(); + + Map getMap() { + return map; + } + + } + + static class TestObject2 { + + private final Map map = Map.of(); + + Map getMap() { + return map; + } + + } } diff --git a/test-framework/junit5/src/main/java/io/quarkus/test/junit/internal/CustomMapConverter.java b/test-framework/junit5/src/main/java/io/quarkus/test/junit/internal/CustomMapConverter.java index ada99f29fa331..fe93cb8594587 100644 --- a/test-framework/junit5/src/main/java/io/quarkus/test/junit/internal/CustomMapConverter.java +++ b/test-framework/junit5/src/main/java/io/quarkus/test/junit/internal/CustomMapConverter.java @@ -5,7 +5,7 @@ import java.util.Map; import java.util.Set; -import com.thoughtworks.xstream.converters.collections.CollectionConverter; +import com.thoughtworks.xstream.converters.collections.MapConverter; import com.thoughtworks.xstream.mapper.Mapper; /** @@ -16,7 +16,7 @@ * The reason for doing this is to avoid XStream causing illegal access issues * for internal JDK maps */ -public class CustomMapConverter extends CollectionConverter { +public class CustomMapConverter extends MapConverter { // if we wanted to be 100% sure, we'd list all the Set.of methods, but I think it's pretty safe to say // that the JDK won't add custom implementations for the other classes