Skip to content

Commit

Permalink
Emphasize the need to add quarkus-junit5-mockito as a dependency to u…
Browse files Browse the repository at this point in the history
…se mock injection
  • Loading branch information
jponge committed Mar 1, 2024
1 parent 962bae3 commit 986244b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/src/main/asciidoc/getting-started-testing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
----
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-mockito</artifactId>
<scope>test</scope>
</dependency>
----
====

Using `@InjectMock`, the previous example could be written as follows:

Expand Down

0 comments on commit 986244b

Please sign in to comment.