@QuarkusMain not called from @QuarkusTest #19957
Labels
area/testing
env/windows
Impacts Windows machines
kind/bug
Something isn't working
triage/out-of-date
This issue/PR is no longer valid or relevant
Describe the bug
When @QuarkusTest is executed in combination with @QuarkusMain definition, the main class is not being called, but neither is the default configuration context which is normally executed when no @QuarkusMain is defined. This results in "underconfigured" system.
This prevents proper usage of @QuarkusMain for any customizations because they are then not available during @QuarkusTest context. One example would be apache-camel integration when routes are not being registered in such setup, but it seems to be a generic problem.
Expected behavior
@QuarkusMain annotated class is executed on application startup when @QuarkusTest is being executed.
Actual behavior
@QuarkusMain class is not being executed at all.
How to Reproduce?
I've setup a simple apache camel-timer based reproducer to see that neither the default context nor @QuarkusMain context is being properly configured in @QuarkusTest tests.
To reproduce simply uncomment the @QuarkusMain annotation on MainQuark class and execute the test in TimerRouteTest.
You can observe that:
mainquark.zip
Output of
uname -a
orver
Microsoft Windows [Version 10.0.19043.1165]
Output of
java -version
openjdk version "11" 2018-09-25
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.1.3.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.1
Additional information
No response
The text was updated successfully, but these errors were encountered: