Start MockServer
Run MockServer as a Docker container, exposed on port 1080:MockServer is now listening at
http://localhost:1080. A single port handles both HTTP and HTTPS.Create an expectation
An expectation tells MockServer what requests to match and what response to return. Create one using the REST API, the Java client, or the JavaScript client.MockServer responds with
201 Created when the expectation is registered successfully.Make a request to the mock
Send a request to MockServer on the path you configured:MockServer matches the request against your expectation and returns the configured response:
Verify the request was received
After your test runs, verify that MockServer received the expected request. Use the REST API or a client SDK.MockServer returns
202 Accepted if the verification passes, or a 406 Not Acceptable with a description of what was received if it fails.The request log is only captured when the log level is
INFO or more verbose. MockServer defaults to INFO, so verification works out of the box.Next steps
Creating expectations
Learn all the ways to match requests and define responses, including callbacks and forwarding.
Request matchers
Match on headers, cookies, query parameters, body content, and more.
OpenAPI mocking
Auto-generate expectations from an OpenAPI v3 specification.
Verification
Assert request sequences and counts after your tests run.