Test third-party integrations in a controlled environment
Define custom API routes, request/response formats, and timing behaviors to simulate external services. Keep your integration tests reliable, fast, and independent of third-party API availability.
routes:
- path: /api/users
rules:
- method: get
response:
status: 200
body: '[{"name": "John"}]'
Powerful Capabilities
Everything you need for reliable integration testing
Precise Route Matching
Match requests exactly by HTTP methods, headers, query parameters, and request bodies with full control.
Simulate Delays
Add configurable wait times to test slow responses and network timeouts exactly as they happen.
Custom Responses
Return any status code, headers, and response bodies to thoroughly test all scenarios.
Simple Configuration
Define routes and behaviors in clean YAML files for easy maintenance and team collaboration.
Fast & Isolated
Lightweight Go server runs locally or in CI/CD without external dependencies or delays.
Full HTTP Support
Support for GET, POST, PUT, PATCH with complete request validation and response control.
Why Use MockThirdParty?
Run integration tests without counting against your third-party API rate limits. Test as often as you need.
Tests never fail due to third-party service outages or maintenance windows.
No network latency - run tests locally with instant responses or controlled delays.
Simulate error responses, timeouts, and uncommon scenarios that are hard to reproduce with real APIs.
Embed in your automated testing pipeline for consistent, repeatable integration tests.
Share YAML configurations across teams for consistent testing scenarios.
Simple Configuration, Powerful Results
Define your routes in clean YAML. Point the binary at a single file or a directory of files — the emulator handles request matching, timing, and response formatting automatically.
- ✅ Intuitive syntax
- ✅ Single file or directory of files
- ✅ Version control friendly
routes:
- path: /v1/test
rules:
- method: get
args:
- name: author
value: stephen-king
response:
status: 200
body: '[{"title": "cujo"}]'
- path: /v1/post
rules:
- method: post
body: '{"username": "test"}'
wait: 2s
response:
status: 200
body: '{"success": true}'
Get Started in Minutes
Simple installation, immediate results
Install
go install gitlab.com/iferminm/thirdparty/cmd/thirdparty@latest
Drops a thirdparty binary in $(go env GOPATH)/bin.
Configure Routes
Create routes.yml anywhere:
routes:
- path: /api/example
rules:
- method: get
response:
status: 200
body: '{"message": "Hello World"}'
Run
thirdparty --routes routes.yml --port 8080
Pass a directory instead of a file to load every .yml / .yaml inside it. Use --port 0 for a kernel-assigned port.