Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarkus testing with @ParameterizedTest using Map (entries) broken with Java 17 + 18 (xstream) #25027

Closed
xtaixe opened this issue Apr 20, 2022 · 3 comments · Fixed by #25038
Closed
Labels
area/testing kind/bug Something isn't working
Milestone

Comments

@xtaixe
Copy link

xtaixe commented Apr 20, 2022

Describe the bug

This is the same issue as #24492 but when the @MethodSource returns a Stream<Map.Entry<String, String>> (created from a static final Map<String, String> field). The error is:

com.thoughtworks.xstream.converters.ConversionException: 
No converter available
---- Debugging information ----
message             : No converter available
type                : java.util.KeyValueHolder
converter           : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
message[1]          : Unable to make field final java.lang.Object java.util.KeyValueHolder.key accessible: module java.base does not "opens java.util" to unnamed module @7219ec67
-------------------------------

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

@QuarkusTest
class ResourceTest {
    private static final Map<String, String> MAP = Map.of("a", "b");

    private static Stream<Map.Entry<String, String>> params() {
        return MAP.entrySet().stream();
    }

    @ParameterizedTest
    @MethodSource("params")
    void testReadOnlyDataResource(Map.Entry<String, String> pathAndExpectedValueEntry) {
        ...
    }
}

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.8.1.Final

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@xtaixe xtaixe added the kind/bug Something isn't working label Apr 20, 2022
@geoand
Copy link
Contributor

geoand commented Apr 20, 2022

Mind adding the exact snippet that causes the issue?

Thanks

@xtaixe
Copy link
Author

xtaixe commented Apr 20, 2022

@geoand done.

@geoand
Copy link
Contributor

geoand commented Apr 20, 2022

Thanks

geoand added a commit to geoand/quarkus that referenced this issue Apr 20, 2022
geoand added a commit to geoand/quarkus that referenced this issue Apr 20, 2022
@quarkus-bot quarkus-bot bot added this to the 2.9 - main milestone Apr 20, 2022
gsmet added a commit that referenced this issue Apr 20, 2022
Fix Map.Entry handling of parameterized tests
@gsmet gsmet modified the milestones: 2.9 - main, 2.8.2.Final Apr 24, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Apr 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants