Exporting Tests, Mocks & Contracts

Tests, mocks, and contracts can be exported to most popular coding languages and frameworks like Python, Java, Javascript, and Postman. Mocks can be exported to various mock hosting solutions like Wiremock, HoverFly, and Postman.

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.

Download Tests, Mocks and Contracts This is how the folder looks when opened:

[zipped folder]/
├── tests/
├── mocks/
└── contracts/

Tests, Mocks and Contracts Folder

Tests

The tests.py file in the tests folder includes the complete contract test-suite and covers all endpoints that were observed in service traffic.

[zipped folder]/
├── tests/
    ├── tests.py

Tests generated by Machine Learning

The readme file within the folder includes instructions on how to run tests from your local machine. You can run all tests at once or run specific tests by using the pytest command:

Copy to clipboard
pytest tests.py::<service>::<endpoint>

PyTest Execution

Mocks

The 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

To run one or more of these mocks you can follow the instructions in 'Mocks', or in the new open-source project, Mockintosh.

MIT License

All artifacts come as open source with an MIT license.

Support

For support, feel free to use any one of the three: