From 986244bdf7a4a6f8c58fe2d0b3fa08fd83d4093d Mon Sep 17 00:00:00 2001 From: Julien Ponge Date: Thu, 29 Feb 2024 19:30:03 +0100 Subject: [PATCH] Emphasize the need to add quarkus-junit5-mockito as a dependency to use mock injection --- .../main/asciidoc/getting-started-testing.adoc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/src/main/asciidoc/getting-started-testing.adoc b/docs/src/main/asciidoc/getting-started-testing.adoc index 9d62dc16b4d58..76c6c9c149937 100644 --- a/docs/src/main/asciidoc/getting-started-testing.adoc +++ b/docs/src/main/asciidoc/getting-started-testing.adoc @@ -843,7 +843,20 @@ So if you need to call methods such as `verify` you should hang on to the mock i ==== Further simplification with `@InjectMock` Building on the features provided by `QuarkusMock`, Quarkus also allows users to effortlessly take advantage of link:https://site.mockito.org/[Mockito] for mocking the beans supported by `QuarkusMock`. -This functionality is available with the `@io.quarkus.test.InjectMock` annotation if the `quarkus-junit5-mockito` dependency is present. + +[IMPORTANT] +==== +This functionality is available with the `@io.quarkus.test.InjectMock` annotation **only if** the `quarkus-junit5-mockito` dependency is present: +[source,xml] +---- + + io.quarkus + quarkus-junit5-mockito + test + +---- + +==== Using `@InjectMock`, the previous example could be written as follows: