snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

QuarkusIntegrationTest cannot be run with failsafe in JVM mode #374

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

Describe the bug

When trying to use failsafe to run a @QuarkusIntegrationTest in JVM mode (outside the native profile), test executions fails.

Expected behavior

As documented here, QuarkusIntegrationTest can be run with failsafe.

Actual behavior

Test execution fails with the following error message, GreetingResourceTestIT being the test class annotated with @QuarkusIntegrationTest:

[INFO] Running org.acme.rest.GreetingResourceIT
2021-07-08 18:50:04,290 WARN  [io.qua.hib.orm.run.pro.ProxyDefinitions] (main) Could not generate an enhanced proxy for entity 'org.acme.rest.FooEntity' (class='org.acme.rest.FooEntity') as it's final. Your application might perform better if we're allowed to extend it.
2021-07-08 18:50:04,942 INFO  [io.quarkus] (main) Quarkus 2.0.1.Final on JVM started in 2.115s. Listening on: http://localhost:8081
2021-07-08 18:50:04,942 INFO  [io.quarkus] (main) Profile test activated. 
2021-07-08 18:50:04,942 INFO  [io.quarkus] (main) Installed features: [agroal, cdi, hibernate-orm, hibernate-orm-panache-kotlin, jdbc-h2, kotlin, narayana-jta, resteasy, resteasy-jackson, smallrye-context-propagation]
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.254 s <<< FAILURE! - in org.acme.rest.GreetingResourceIT
[ERROR] org.acme.rest.GreetingResourceIT  Time elapsed: 4.254 s  <<< ERROR!
org.junit.jupiter.api.extension.TestInstantiationException: Failed to create test instance
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
Caused by: java.lang.reflect.InvocationTargetException
Caused by: javax.enterprise.inject.UnsatisfiedResolutionException: No bean found for required type [class org.acme.rest.GreetingResourceIT] and qualifiers [[]]

To Reproduce

  1. Clone the reproduction repository
  2. mvn verify

I also tried reproducing this from an even smaller project, but then this bug is not triggered. So there might be an interaction with other extensions configured in this project.

Configuration

included

Environment (please complete the following information):

Output of uname -a or ver

Linux pres 5.10.47-1-lts #1 SMP Wed, 30 Jun 2021 13:52:19 +0000 x86_64 GNU/Linux

Output of java -version

openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9)
OpenJDK 64-Bit Server VM (build 11.0.11+9, mixed mode)

GraalVM version (if different from Java)

not needed

Quarkus version or git rev

2.0.1.Final

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

Apache Maven 3.8.1 (NON-CANONICAL_2021-04-26T21:52:54Z_root)
Maven home: /opt/maven
Java version: 11.0.11, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-11-openjdk
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.10.47-1-lts", arch: "amd64", family: "unix"

Additional context

(Add any other context about the problem here.)


https://github.com/quarkusio/quarkus/issues/18537


$upstream:18537$