quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.54k stars 2.61k forks source link

Records that contain Enum are still unsupported with @ParameterizedTest even with Serializable in 3.13.0 #42301

Closed yk-littlepay closed 6 days ago

yk-littlepay commented 1 month ago

Describe the bug

This is kind of this #40148 , #42006 and#42098. When a @ParameterizedTest contains a record as a parameter that has an enum property the error is thrown like this [ERROR] GreetingResourceTest.should_postUsers(UserRequest)[1] » IllegalState Error calling onstructor on record class class org.acme.model.UserRequest if remove enum then it starts to work.

PS. But the same test works fine with Serializable as expected in 3.12.3

Expected behavior

Each @ParameterizedTest must accept a record containing a property of Enum<E extends Enum<E>> type

Actual behavior

Each @ParameterizedTest is failed if a parameter is a record that contains enum property

How to Reproduce?

Create any @ParameterizedTest with @MethodSource("requestSamples") where the method requestSamples provides a Stream<SomeRecord> and SomeRecord looks like

public record SomeRecord(String name, SomeEnum someEnum) { 
    enum SomeEnum { A, B, C }
}

here is some project example code-with-quarkus.zip

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

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

No response

Additional information

No response

gsmet commented 1 month ago

@dmlloyd could you have a look at this one? It's a regression in 3.13.

quarkus-bot[bot] commented 1 month ago

/cc @geoand (testing)

holly-cummins commented 1 month ago

Another side effect of #40601.

geoand commented 1 month ago

https://github.com/jboss-remoting/jboss-marshalling/pull/147 fixes the problem, but I am really not sure it's the proper fix, so we'll have to wait until @dmlloyd is back :)