Skip to content

Commit 26e23f9

Browse files
committed
Polish MockitoExtension example in User Guide
1 parent e0fa02b commit 26e23f9

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

documentation/src/docs/asciidoc/writing-tests.adoc

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,23 +198,28 @@ Using `@RunWith(JUnitPlatform.class)` will even output all reported entries to `
198198
include::{testDir}/example/TestReporterDemo.java[tags=user_guide]
199199
----
200200

201-
Other parameter resolvers must be explicitly enabled by registering appropriate
201+
NOTE: Other parameter resolvers must be explicitly enabled by registering appropriate
202202
<<extensions,extensions>> via `@ExtendWith`.
203203

204-
* Check out the `{MockitoExtension}` for an example of a `{ParameterResolver}`. While not
205-
intended to be production-ready, it demonstrates the simplicity and expressiveness of
206-
both the extension model and the parameter resolution process. `MyMockitoTest`
207-
demonstrates how to inject Mockito mocks into `@BeforeEach` and `@Test` methods.
204+
Check out the `{MockitoExtension}` for an example of a custom `{ParameterResolver}`.
205+
While not intended to be production-ready, it demonstrates the simplicity and
206+
expressiveness of both the extension model and the parameter resolution process.
207+
`MyMockitoTest` demonstrates how to inject Mockito mocks into `@BeforeEach` and `@Test`
208+
methods.
208209

209210
[source,java,indent=0]
210211
[subs="verbatim"]
211212
----
212-
import com.example.mockito.MockitoExtension;
213-
import org.junit.jupiter.api.*;
214-
import org.mockito.Mock;
215-
213+
import static org.junit.jupiter.api.Assertions.assertEquals;
216214
import static org.mockito.Mockito.when;
217215
216+
import org.junit.jupiter.api.BeforeEach;
217+
import org.junit.jupiter.api.Test;
218+
import org.junit.jupiter.api.extension.ExtendWith;
219+
import org.mockito.Mock;
220+
import com.example.Person;
221+
import com.example.mockito.MockitoExtension;
222+
218223
@ExtendWith(MockitoExtension.class)
219224
class MyMockitoTest {
220225

0 commit comments

Comments
 (0)