Skip to content
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

Endorsed MockitoTestNGListener in the documentation #2140

Merged
merged 1 commit into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/main/java/org/mockito/Mockito.java
Original file line number Diff line number Diff line change
Expand Up @@ -1371,9 +1371,11 @@
*
* To quickly find out how "stricter" Mockito can make you more productive and get your tests cleaner, see:
* <ul>
* <li>Strict stubbing with JUnit Rules - {@link MockitoRule#strictness(Strictness)} with {@link Strictness#STRICT_STUBS}</li>
* <li>Strict stubbing with JUnit Runner - {@link MockitoJUnitRunner.StrictStubs}</li>
* <li>Strict stubbing if you cannot use runner/rule (like TestNG) - {@link MockitoSession}</li>
* <li>Strict stubbing with JUnit4 Rules - {@link MockitoRule#strictness(Strictness)} with {@link Strictness#STRICT_STUBS}</li>
* <li>Strict stubbing with JUnit4 Runner - {@link MockitoJUnitRunner.Strict}</li>
* <li>Strict stubbing with JUnit5 Extension - <code>org.mockito.junit.jupiter.MockitoExtension</code></li>
* <li>Strict stubbing with TestNG Listener <a href="https://github.com/mockito/mockito-testng">MockitoTestNGListener</a></li>
* <li>Strict stubbing if you cannot use runner/rule - {@link MockitoSession}</li>
* <li>Unnecessary stubbing detection with {@link MockitoJUnitRunner}</li>
* <li>Stubbing argument mismatch warnings, documented in {@link MockitoHint}</li>
* </ul>
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/mockito/MockitoSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
* otherwise {@link UnfinishedMockingSessionException} is triggered when the next session is created.
* <p>
* {@code MockitoSession} is useful when you cannot use {@link MockitoJUnitRunner} or {@link MockitoRule}.
* For example, you work with TestNG instead of JUnit.
* Another example is when different JUnit runner is in use (Jukito, Springockito)
* and it cannot be combined with Mockito's own runner.
* <p>
Expand Down Expand Up @@ -74,7 +73,7 @@
* If you are JUnit user who does not leverage Mockito rule or runner we strongly recommend to do so.
* Both the runner and the rule support strict stubbing which can really help driving cleaner tests.
* See {@link MockitoJUnitRunner.StrictStubs} and {@link MockitoRule#strictness(Strictness)}.
* If you cannot use Mockito's JUnit support (for example, you are on TestNG) {@code MockitoSession} exactly is for you!
* If you cannot use Mockito's JUnit support {@code MockitoSession} exactly is for you!
* You can automatically take advantage of strict stubbing ({@link Strictness}),
* automatic initialization of annotated mocks ({@link MockitoAnnotations}),
* and extra validation ({@link Mockito#validateMockitoUsage()}).
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/mockito/junit/MockitoJUnitRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
* </code></pre>
*
* If you would like to take advantage of Mockito JUnit runner features
* but you cannot use the runner because, for example, you use TestNG, there is a solution!
* but you cannot use the runner there is a solution!
* {@link MockitoSession} API is intended to offer cleaner tests and improved debuggability
* to users that cannot use Mockito's built-in JUnit support (runner or the rule).
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/mockito/junit/MockitoRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
* </code></pre>
*
* If you would like to take advantage of Mockito JUnit rule features
* but you cannot use the rule because, for example, you use TestNG, there is a solution!
* but you cannot use the rule there is a solution!
* {@link MockitoSession} API is intended to offer cleaner tests and improved debuggability
* to users that cannot use Mockito's built-in JUnit support (runner or the rule).
*
Expand Down