Replies: 2 comments 2 replies
-
I have the same feeling as @HerrDerb. I'm trying to write unit tests but I don't see a way, and I only find tests with @QuarkusTest which are tests(rest client integration tests). Is there a way to write unitTests in quarkus application? Thanks. |
Beta Was this translation helpful? Give feedback.
-
Yes, just annotate the method with @test without any annotation at class. |
Beta Was this translation helpful? Give feedback.
-
In quarkus, there are
@QuarkusTest
and@QuarkusIntegrationTest
As far as I know, quarkus describes
@QuarkusTest
not as integration tests, which means they are understood as unit tests. Also qaurkus encourages to mainly use@QuarkusTest
for unit tests (at least that's what I feel, as e.g. you run into problems with jacoco when mixing up regular junit test with@QuarkusTest
), altought@QuarkusTest
start the whole application context with DI and which is definetly way above the scope of a unit test. In other words@QuarkusTest
exactly represents what an integration test is. This seems like quarkus is discurraging writing regular plain and fast unit tests, which seems really weird to me and definitly not best practice.Then we have
@QuarkusIntegrationTest
, which represent black box service test. Which are actually again, above the scope of an integration test.I'm am really confused of the whole quarkus test concept and it feels to me like well reasoned principles are just thrown over board for something "new, cool and fancy".
What are the reasons for those decisions? Meybe there is something I didn't understand?
Beta Was this translation helpful? Give feedback.
All reactions