Skip to content

smartsheet/smartsheet-sdk-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smartsheet SDK Contract Testing with WireMock

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.

How does it work?

  • 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-id is 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).

Running WireMock

To start the WireMock server with the provided mappings:

docker compose up

This will start a container with a WireMock server on http://localhost:8082 with the mappings mounted from the mappings/ directory.

Contributing

We welcome contributions! Before submitting code changes, please review our contribution guidelines in CONTRIBUTING.md.

About

Mock test suite for all language SDKs

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 8