You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/asciidoc/testing.adoc
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,7 @@ class TestApp {
68
68
69
69
Simple and easy {love}!
70
70
71
-
The javadoc:MockRouter[] returns the value produced by the route handler. It is possible to get
71
+
The javadoc:test.MockRouter[artifact=jooby-test] returns the value produced by the route handler. It is possible to get
72
72
access and check response metadata:
73
73
74
74
.App
@@ -128,7 +128,7 @@ class TestApp {
128
128
}
129
129
----
130
130
131
-
For more complex route context interaction or responses, you can pass in a javadoc:MockContext[]:
131
+
For more complex route context interaction or responses, you can pass in a javadoc:test.MockContext[artifact=jooby-test]:
132
132
133
133
.App
134
134
[source,java,role="primary"]
@@ -245,14 +245,14 @@ For MVC routes you might prefer to write a unit test using a mock library. No ne
245
245
246
246
==== Options
247
247
248
-
- javadoc:MockRouter[setFullExecution]: the javadoc:MockRouter[] class ONLY execute the route
249
-
handler. For executing the entire pipeline use: javadoc:MockRouter[setFullExecution].
248
+
- javadoc:test.MockRouter[setFullExecution, boolean, artifact=jooby-test]: the javadoc:test.MockRouter[artifact=jooby-test] class ONLY execute the route
249
+
handler. For executing the entire pipeline use: javadoc:test.MockRouter[setFullExecution, boolean, artifact=jooby-test].
250
250
251
-
- javadoc:Jooby[setLateInit]: extension modules usually run at the time they are installed it.
252
-
This might not be ideally for unit tests. To delay extension initialization use the javadoc:Jooby[setLateInit] mode.
251
+
- javadoc:Jooby[setLateInit, boolean]: extension modules usually run at the time they are installed it.
252
+
This might not be ideally for unit tests. To delay extension initialization use the javadoc:Jooby[setLateInit, boolean] mode.
253
253
254
-
Unit testing is simple and easy in Jooby. The javadoc:MockRouter[] let you execute the route function,
255
-
while the javadoc:MockContext[] allows you to create an light-weight and mutable context where
254
+
Unit testing is simple and easy in Jooby. The javadoc:test.MockRouter[artifact=jooby-test] let you execute the route function,
255
+
while the javadoc:test.MockContext[artifact=jooby-test] allows you to create an light-weight and mutable context where
256
256
you can set HTTP parameters, body, headers, etc.
257
257
258
258
=== Integration Testing
@@ -343,9 +343,9 @@ The example uses https://square.github.io/okhttp/[OkHttp] client, but you are fr
343
343
344
344
Simple and easy {love}!
345
345
346
-
The javadoc:JoobyTest[] takes care of start and stop the application.
346
+
The javadoc:test.JoobyTest[artifact=jooby-test] takes care of start and stop the application.
347
347
348
-
The default port is: `8911`. Application port can be configured directly using the javadoc:JoobyTest[port] method:
348
+
The default port is: `8911`. Application port can be configured directly using the javadoc:test.JoobyTest[port, artifact=jooby-test] method:
349
349
350
350
`@JoobyTest(value = App.class, port = 9999)`
351
351
@@ -391,7 +391,7 @@ Here is the list of available injectable values:
391
391
392
392
These values can be injected via parameter or instance fields.
393
393
394
-
The javadoc:JoobyTest[] annotation starts the application using the `test` environment name. You can
394
+
The javadoc:test.JoobyTest[artifact=jooby-test] annotation starts the application using the `test` environment name. You can
395
395
creates a `conf/application.test.conf` file to override any other values for testing purpose.
0 commit comments