Continuous testing fails when @QuarkusMainTest
and a @ConfigMapping
are involved
#22792
Labels
Milestone
@QuarkusMainTest
and a @ConfigMapping
are involved
#22792
Describe the bug
Running a test annotated with
@QuarkusMainTest
in continuous testing mode where another test tests a config mapping defined by@ConfigMapping
causes the test to fail with aClassCastException
:It is important that the test testing the
@ConfigMapping
is run before the@QuarkusMainTest
. The other way round the behavior couldn't be observed.The tests pass when run with
./mvnw clean verify
Expected behavior
Tests passing when run with
./mvnw clean verify
also pass when run in continuous testing mode.Actual behavior
When a test using an injected
@ConfigMapping
is run before a@QuarkusMainTest
the@QuarkusMainTest
fails with a class cast exception:How to Reproduce?
quarkus dev
@QuarkusMainTest
-> pass@QuarkusMainTest
and removeConfigurationTest
-> passConfigurationTest
againConfigurationTest.java
toGreetingConfigurationTest.java
to ensure it is run after the@QuarkusMainTest
inGreetingCommandTest.java
quarkus dev
-> fail, but not because of theClassCastException
but because of what is described in LaunchResult#getOutput() behaves differently in continuous testing mode than with./mvnw clean verify
#22790quarkus dev
./mvnw clean verify
-> passOutput of
uname -a
orver
Darwin cdh 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:29:10 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T8101 arm64
Output of
java -version
java version "17" 2021-09-14 LTS Java(TM) SE Runtime Environment (build 17+35-LTS-2724) Java HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.6.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d) Maven home: ~/.m2/wrapper/dists/apache-maven-3.8.1-bin/2l5mhf2pq2clrde7f7qp1rdt5m/apache-maven-3.8.1 Java version: 17, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home Default locale: de_AT, platform encoding: UTF-8 OS name: "mac os x", version: "12.1", arch: "aarch64", family: "mac"
Additional information
No response
The text was updated successfully, but these errors were encountered: