software · Q1683
MockServer
Programmable service mocks, proxy recordings and fault injection for trusted test environments.
Overview
MockServer is an Apache-2.0 mock server and proxy for isolating service dependencies during development and testing. It matches requests to configured expectations, can record upstream interactions and supports controlled delays or failures for testing client behavior.[2]
Programmable expectations
Expectations connect request conditions with canned, templated or callback-based responses. Matching can inspect methods, paths, headers, cookies and bodies, including structured JSON and XML criteria. Client libraries and an HTTP control interface let a test suite configure behavior programmatically. The current project also documents a dashboard, several deployment formats and fault injection; these capabilities serve controlled test environments rather than a production application backend.[2]
Capturing dependencies
Proxy traffic can be retrieved as editable recorded expectations, including JSON or Java representations. This lets a team turn observed interactions into fixtures and adjust them when the API changes. Plain retrieval leaves recorded output unchanged unless generalization or consolidation options are enabled. The recordings/promote endpoint follows different defaults: it consolidates, parameterizes and redacts credentials by default before activating the mocks. Matching still needs checking against the intended requests; neither workflow guarantees that every future identifier or timestamp will match.[3]
Saving fixtures between runs
Authored expectations and recorded proxy expectations have separate persistence controls and can be saved to different files. Replaying a saved recording after restart requires loading the corresponding file as initialization data. Recording traffic, persisting it and restoring a mock are thus distinct steps. A test setup should make the intended fixture source explicit rather than assuming all state survives a process restart.[4]
Runtime and trust boundary
MockServer's current repository specifies Java 17 or newer for the runtime, while the official container includes its own JVM. The source is Apache-2.0 licensed. Its security policy explicitly limits intended use to development, testing and QA, with trusted users, expectations and networks; it advises against production deployment or exposure to untrusted networks. These constraints matter when choosing a shared test server.[1][2][5]
Substitution scope
MockServer can substitute for WireMock for programmable HTTP dependency simulation and proxy-derived fixtures. Both can decouple a test from live upstream responses, but use different configuration and recording models. This is not a claim of compatible mapping files or identical matching precedence. Teams should translate expectations, verify persistence and reset behavior, and isolate the service according to its documented trust assumptions before relying on migrated tests.[2][3][5][6][7]
Capabilities & limitations
Programmable mocks
supportedRequest matchers choose authored, templated or callback responses.[2]
Programmatic service dependency testing · Java 17+, Docker, Kubernetes · Version, runtime and trusted development/test environment requirements apply.
1 source · check evidence
Request matching, fault injection, distribution and Java requirements
vendor · checked 2026-10-07Recorded expectation persistence
limitedRecorded and authored expectations have separate persistence and initialization settings.[4]
Programmatic service dependency testing · Java 17+, Docker, Kubernetes · Version, runtime and trusted development/test environment requirements apply.
1 source · check evidence
Separate persistence controls for authored and recorded expectations
vendor · checked 2026-10-07Untrusted public deployment
unsupportedProject security policy restricts use to trusted development/test environments.[5]
Programmatic service dependency testing · Java 17+, Docker, Kubernetes · Version, runtime and trusted development/test environment requirements apply.
1 source · check evidence
Development/testing-only posture and trusted environment assumptions
vendor · checked 2026-10-07Can substitute for
These are products or services this entry can replace. Check the task and limitations for each comparison.
WireMock for Programmatic service dependency testing
limitedCan replace programmable HTTP mocks and record/replay fixtures; expectations, persistence and matching behavior require migration.[2][3][6]
Java 17+, Docker, Kubernetes · Version, runtime and trusted development/test environment requirements apply.
References
- MockServer license
Apache License 2.0
vendor · retrieved 2026-10-07 - MockServer repository
Request matching, fault injection, distribution and Java requirements
vendor · retrieved 2026-10-07 - MockServer record and replay
Plain retrieval versus recordings/promote: consolidation, parameterization and redaction defaults; checked 2026-10-14.
vendor · retrieved 2026-10-14 - Persisting MockServer expectations
Separate persistence controls for authored and recorded expectations
vendor · retrieved 2026-10-07 - MockServer security policy
Development/testing-only posture and trusted environment assumptions
vendor · retrieved 2026-10-07 - WireMock standalone service
Java/JSON configuration and JAR/container distribution
vendor · retrieved 2026-10-07 - WireMock record and playback
Recording and snapshotting stub mappings
vendor · retrieved 2026-10-07
Discussion & disputes
Ask about unclear claims or explain a concern with supporting sources. If you have a specific fix, suggest a correction.
No discussion yet.
Revision history
Open a revision to read an earlier version of this article.
| Revision | Timestamp | Edit summary |
|---|---|---|
| 1796 | 2026-10-26 06:45:50 | /* wbeditentity-create-item:0| */ sf:87dd5538-0183-4ca1-8571-066bc6d0fe80:v2 | Resolve the record/replay objection by distinguishing opt-in transformations on plain retrieval from the promotion endpoint’s default consolidation, parameteriz | attribution: /proposals/87dd5538-0183-4ca1-8571-066bc6d0fe80 |