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
When using @QuarkusMainTest and @Launch, junit @BeforeEach is executed after launching the app #26711
Comments
geoand
added a commit
to geoand/quarkus
that referenced
this issue
Jul 14, 2022
geoand
added a commit
to geoand/quarkus
that referenced
this issue
Jul 14, 2022
The way this is done is pretty much a hack, but we either have to do it this way, or document that the combination of the two does not work as expected Fixes: quarkusio#26711
geoand
added a commit
to geoand/quarkus
that referenced
this issue
Jul 15, 2022
The way this is done is pretty much a hack, but we either have to do it this way, or document that the combination of the two does not work as expected Fixes: quarkusio#26711
geoand
added a commit
to geoand/quarkus
that referenced
this issue
Sep 8, 2022
The way this is done is pretty much a hack, but we either have to do it this way, or document that the combination of the two does not work as expected Fixes: quarkusio#26711
geoand
added a commit
that referenced
this issue
Sep 8, 2022
Ensure that @Launch works with @beforeeach
evanchooly
pushed a commit
to nenros/quarkus
that referenced
this issue
Sep 8, 2022
The way this is done is pretty much a hack, but we either have to do it this way, or document that the combination of the two does not work as expected Fixes: quarkusio#26711
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
Sep 12, 2022
The way this is done is pretty much a hack, but we either have to do it this way, or document that the combination of the two does not work as expected Fixes: quarkusio#26711 (cherry picked from commit 9be7834)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
To test a command mode app i have a test class annotated with
@QuarkusMainTest
and a test resource that fires up a dynamodb container.I want to run some logic before launching the batch, but if i annotate a method with junit
@BeforeEach
it is run after the app has already been launched by@Launch
.I also tried with a manual invocation with
QuarkusMainLauncher
but this time the dynamodb test resource isn't started.Expected behavior
In a test class annotated with
@QuarkusMainTest
and a test method annotated with@Launch
and@Test
, a method annotated with@BeforeEach
is run before the app is actually launched.Also, when using standard
@Test
methods (not annotated with@Launch
) andQuarkusMainLauncher
test resources are executed.Actual behavior
In a test class annotated with
@QuarkusMainTest
and a test method annotated with@Launch
and@Test
, a method annotated with@BeforeEach
is run after the app is actually launched.Also, when using standard
@Test
methods (not annotated with@Launch
) andQuarkusMainLauncher
test resources are not executed.How to Reproduce?
Create a test with the scenario describe above, here's my test class simplified a bit :
Output of
uname -a
orver
Darwin LM-C02ZC045L415 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:22 PDT 2022; root:xnu-8020.121.3~4/RELEASE_X86_64 x86_64
Output of
java -version
openjdk version "17.0.1" 2021-10-19 LTS OpenJDK Runtime Environment Corretto-17.0.1.12.1 (build 17.0.1+12-LTS) OpenJDK 64-Bit Server VM Corretto-17.0.1.12.1 (build 17.0.1+12-LTS, mixed mode, sharing)
GraalVM version (if different from Java)
22.1.0
Quarkus version or git rev
2.9.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Additional information
No response
The text was updated successfully, but these errors were encountered: