Mock HTTP services for integration tests with WireMock.
448
Mock HTTP services for integration tests with WireMock.
You learn to use wiremock in a Docker container.
/__admin//demo stub that returns {"status": "ok"}| Tag | Meaning | Platform |
|---|---|---|
latest | Latest successful main build | linux/amd64 |
docker pull stden/wiremock:latest
docker run -d -p 127.0.0.1:8080:8080 --name wiremock stden/wiremock:latest
Check the demo stub:
curl http://127.0.0.1:8080/demo
List all mappings:
curl http://127.0.0.1:8080/__admin/mappings
Add a new stub at runtime:
curl -X POST http://127.0.0.1:8080/__admin/mappings \
-H 'Content-Type: application/json' \
-d '{"request":{"url":"/hello"},"response":{"body":"world"}}'
CI builds the image and verifies WireMock starts.
The local test starts WireMock, calls the /demo stub, and checks the admin API.
Content type
Image
Digest
sha256:f14d2a899…
Size
121.3 MB
Last updated
1 day ago
docker pull stden/wiremock