Service mocks provide predictable behavior from service dependencies to speed up both the development and testing stages. You also don't need to deploy the original services, removing the CPU, RAM, and HDD requirements.
Accessing the Artifacts
Once you have UP9 installed and observing service traffic, you can download a zip file that includes all of the tests, mocks, and contracts that belong to the current workspace.
[zipped folder]/ ├── tests/ ├── mocks/ └── contracts/
mocks folder includes mock configuration for all services that were observed in service traffic.
mockintosh.yml- main file with all mocked endpoints
mock-data- a directory that contains response payloads.
docker-compose.yml- Easy way to spin up all services as mocks
Running Mockintosh as single process
Each service will use a different port from 8000 and above, so ensure you've supplied enough ports to Docker command:
docker run -it -p 8000-8005:8000-8005 -v `pwd`:/tmp testrio/mockintosh /tmp/mockintosh.yml
Running Mocks Locally
Each service will use a different port from 8000 and above.
Install the software and run mockintosh:
pip3 install mockintosh
mockintosh.yml will start your mock services, as below:
[2021-02-02 13:34:17,775 root INFO] Mockintosh v0.6.2 is starting... [2021-02-02 13:34:17,775 root INFO] Reading configuration file from path: mockintosh.yml [2021-02-02 13:34:17,810 root INFO] Configuration file is a valid YAML file. [2021-02-02 13:34:17,817 root INFO] Configuration file is valid according to the JSON schema. [2021-02-02 13:34:17,920 root INFO] Serving at http://localhost:8001 the mock for 'http://carts' ... [2021-02-02 13:34:17,921 root INFO] Serving at http://localhost:8008 the mock for 'http://user' [2021-02-02 13:34:17,921 root INFO] Serving at http://localhost:8009 the mock for 'http://zipkin' [2021-02-02 13:34:17,921 root INFO] Mock server is ready!
All artifacts come as open source with an MIT license.
For more information on using Mockintosh, including mocking Kafka buses and remote management, visit Mockintosh.
For support, feel free to use any one of the three: