Rename expect() to stubs() in mock server config
This commit is contained in:
@@ -71,14 +71,16 @@ Spring `MockRestServiceServer`. Here's an example:
|
||||
include::{doc_samples}/src/test/java/com/example/WiremockForDocsMockServerApplicationTests.java[tags=wiremock_test]
|
||||
----
|
||||
|
||||
The `baseUrl` is prepended to all mock calls, and the `expect()`
|
||||
method takes a stub name as an argument, where the stubs are stored in
|
||||
the classpath at `/stubs/<name>.json` by default. So in this example
|
||||
the stub defined at `/stubs/resource.json` is loaded into the mock
|
||||
server, so if the `RestTemplate` is asked to visit
|
||||
`http://example.org/` it will get the responses as declared there. The
|
||||
JSON format is the normal WireMock format which you can read about in
|
||||
the WireMock website.
|
||||
The `baseUrl` is prepended to all mock calls, and the `stubs()`
|
||||
method takes a stub path resource pattern as an argument. So in this
|
||||
example the stub defined at `/stubs/resource.json` is loaded into the
|
||||
mock server, so if the `RestTemplate` is asked to visit
|
||||
`http://example.org/` it will get the responses as declared
|
||||
there. More than one stub pattern can be specified, and each one can
|
||||
be a directory (for a recursive list of all ".json"), or a fixed
|
||||
filename (like in the example above) or an ant-style pattern. The JSON
|
||||
format is the normal WireMock format which you can read about in the
|
||||
WireMock website.
|
||||
|
||||
Currently we support Tomcat, Jetty and Undertow as Spring Boot
|
||||
embedded servers, and Wiremock itself has "native" support for a
|
||||
|
||||
Reference in New Issue
Block a user