Skip to content

Commit

Permalink
Document using @Mock with method parameters (#1961)
Browse files Browse the repository at this point in the history
Although we've called it out in the [JUnit extension], we should also
make sure it's clear in the core documentation to make it more visible.

We can fully-quality the `@Test` annotation to make clear that it has to
be with JUnit 5.

Closes #1960.

[JUnit extension]: https://javadoc.io/doc/org.mockito/mockito-junit-jupiter/latest/org/mockito/junit/jupiter/MockitoExtension.html
  • Loading branch information
jamietanna committed Jun 29, 2020
1 parent 0501e02 commit 87aacae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/org/mockito/Mockito.java
Expand Up @@ -455,6 +455,9 @@
* @Mock private UserProvider userProvider;
*
* private ArticleManager manager;
*
* @org.junit.jupiter.api.Test
* void testSomethingInJunit5(@Mock ArticleDatabase database) {
* </code></pre>
*
* <b>Important!</b> This needs to be somewhere in the base class or a test
Expand Down

0 comments on commit 87aacae

Please sign in to comment.