Skip to content

reneebetina/wiremock-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup:

  1. Install docker desktop

    • Open command line docker --version
    • Get latest wiremock image: docker pull wiremock/wiremock
  2. Create a folder (repo) and it MUST HAVE this structure

AnyProjectName

  • docker-compose.yml : default configuration; you can set any container name here.
  • /__files
    • contains all response json files
  • /mappings
    • contains all endpoints and it should point to response json in __files folder
  1. Open command line, go to the path of your wiremock project.

  2. Bring up local mock server: docker-compose up

  3. To check all available mappings: http://localhost:8080/__admin/mappings

    • you can chose to use a different port #, just set it on your yaml file
  4. Call your endpoints:

. http://localhost:8080/<yourUrlHere>

  • you can use it in your automation
  • or on Postman
  1. Bring down local mock server: docker-compose down or you can simply use docker desktop and click on stop button

For any changes in your mocks, you can click 'restart'

READ MORE About Request Matching samples/keywords: https://wiremock.org/docs/request-matching/

For dynamic responses: Read more on https://wiremock.org/2.x/docs/response-templating/ If you want dynamic response (i.e random tokens / uuids), add "transformers": ["response-template"] inside the response

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors