This repository is just an example of how to use wiremock in a docker container, plus some scripts I myself created for copying files from the host computer to the wiremock container, and generate a request and response files linking the response file inside the request.
#start the container
docker-compose up
#add your files inside the folders
wiremock/
\... __files/
\... mappings/
#update it will copy the files to the container
./update
Before using, check the versions of your docker and docker-compose.
docker version 19.03.11
docker-compose version 1.17.1
For starting the container execute:
docker-compose up
For generating a request, use the parameters following the model bellow:
# $1=FILENAME $2=VERB $3=URI $4=STATUS $5=BODYFILE
./request_template.sh request_file.json GET /api/hello-world 200 response_file.json
The update is going to copy the files to the container and reload it:
./update
Pull requests are welcome. Please make sure to update tests as appropriate.