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

QuarkusMainTest does not support QuarkusTestResourceLifecycleManager injection #25065

Closed
ghost opened this issue Apr 21, 2022 · 2 comments · Fixed by #25085
Closed

QuarkusMainTest does not support QuarkusTestResourceLifecycleManager injection #25065

ghost opened this issue Apr 21, 2022 · 2 comments · Fixed by #25085
Labels
area/testing kind/bug Something isn't working
Milestone

Comments

@ghost
Copy link

ghost commented Apr 21, 2022

Describe the bug

For a normal Quarkus test or integration test, one can inject state into the test class using io.quarkus.test.common.QuarkusTestResourceLifecycleManager#inject. This allows one to spin up resources and inject their descriptors into the test

For QuarkusMainTest and QuarkusMainIntegrationTest this functionality seems to be missing, and the injector isn't even called.

Expected behavior

The QuarkusTestResourceLifecycleManager is allowed to inject state into the test class.

Actual behavior

The injector is not called and no injection occurs

How to Reproduce?

Create a QuarkusMainTest that relies in injection from its test profile. Observe that none occurs.

Output of uname -a or ver

macOS Monterey

Output of java -version

OpenJDK Runtime Environment GraalVM CE 22.0.0.2 (build 17.0.2+8-jvmci-22.0-b05)

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)

Gradle 7.4.2

Additional information

Occurs for QuarkusMainTest and QuarkusMainIntegrationTest both when running against a jar and native.

@ghost ghost added the kind/bug Something isn't working label Apr 21, 2022
@quarkus-bot quarkus-bot bot added the area/arc Issue related to ARC (dependency injection) label Apr 21, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Apr 21, 2022

/cc @manovotn, @mkouba

@mkouba mkouba added area/testing and removed area/arc Issue related to ARC (dependency injection) labels Apr 21, 2022
@famod
Copy link
Member

famod commented Apr 21, 2022

/cc @geoand

stuartwdouglas added a commit that referenced this issue Apr 26, 2022
Support QuarkusTestResourceLifecycleManager#inject in CLI test classes
@quarkus-bot quarkus-bot bot added this to the 2.9 - main milestone Apr 26, 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.

2 participants