https://github.com/wiremock/wiremock-templates-demo
WireMock Templates Demo
https://github.com/wiremock/wiremock-templates-demo
Last synced: 5 months ago
JSON representation
WireMock Templates Demo
- Host: GitHub
- URL: https://github.com/wiremock/wiremock-templates-demo
- Owner: wiremock
- Created: 2023-05-30T11:17:58.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-30T11:49:16.000Z (about 3 years ago)
- Last Synced: 2025-06-12T23:41:08.727Z (about 1 year ago)
- Language: Dockerfile
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WireMock API Templates demo
This demo demonstrates using of [WireMock API Templates Library](https://library.wiremock.org/)
in WireMock Standalone packaged as a Docker image.
## Definition
In the demo we will use the _GitHub v3 REST API_ stub that can be found on
[this page](https://library.wiremock.org/catalog/api/github-com-ghes-2-21/).
To use it in the static Docker image,
we just need to download it to the `/home/wiremock/mappings/` directory.
Then the stubs will be automatically loaded on the startup.
```Dockerfile
FROM wiremock/wiremock:2.35.0
RUN mkdir -p /home/wiremock/mappings/
RUN curl https://library.wiremock.org/catalog/api/github-com-ghes-2-21/github.com-ghes-2.21-stubs.json \
--output /home/wiremock/mappings/github.json
```
## Build and then start the image
```bash
docker build -t wiremock/templates-demo .
docker run -it --rm -p 8080:8080 wiremock/templates-demo
```
After this step, you will have a running WireMock instance on port 8080
Now you can use the stubbed GitHub v3 REST API and
all [WireMock Administrative APIs](https://wiremock.org/docs/standalone/administration/)
for test purposes.
## Use API
1. Go to `http://localhost:8080/__admin/` to list all available APIs.
As you can see, there are many of them included into the stub.
2. Go to `http://localhost:8080` to see the list of mocked APIs
3. Go to `http://localhost:8080/organizations` to list the mock organizations