This repository provides a standalone WireMock server implementation for contract testing the Smartsheet SDKs. The server is preloaded with a set of JSON mappings (in the mappings/ directory) that simulate the Smartsheet API. This setup allows us to run tests for all Smartsheet SDKs and ensure consistent behavior and validate API contracts without relying on the live API.
- The WireMock server is loaded with JSON mappings from the
mappings/directory. - Each mapping defines a request to match and a response to return.
- We use a convention of including these two headers in requests:
x-test-name- used for exact mapping matches, allowing us to target different mock responses even if they share the same HTTP method and endpoint.x-request-idis a UUID generated for each request, which helps us trace requests in the WireMock admin history (since we don't have access to the UUIDs generated by WireMock itself).
- Catch-all path patterns are used for test cases that are common to all API endpoints (e.g.,
/errors/500-response).
To start the WireMock server with the provided mappings:
docker compose upThis will start a container with a WireMock server on http://localhost:8082 with the mappings mounted from the mappings/ directory.
We welcome contributions! Before submitting code changes, please review our contribution guidelines in CONTRIBUTING.md.