# MockServer

Programmable service mocks, proxy recordings and fault injection for trusted test environments\.

ID: Q1683 · Revision: 1796

Type: software · License: Apache\-2\.0[^mockserver-license] · Status: active

Website: https://www.mock-server.com/



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\.[^mockserver-readme]

## 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\.[^mockserver-readme]

## 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\.[^mockserver-record]

## 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\.[^mockserver-persist]

## 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\.[^mockserver-readme][^mockserver-license][^mockserver-security]

## Substitution scope

MockServer can substitute for [WireMock](/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\.[^mockserver-readme][^mockserver-record][^mockserver-security][^wiremock-standalone][^wiremock-record]

## Capabilities and substitutions

### Programmable mocks — supported

Request matchers choose authored, templated or callback responses\.[^mockserver-readme]

Use case: Programmatic service dependency testing · Platforms: Java 17\+, Docker, Kubernetes · Region: Version, runtime and trusted development/test environment requirements apply\.

### Recorded expectation persistence — limited

Recorded and authored expectations have separate persistence and initialization settings\.[^mockserver-persist]

Use case: Programmatic service dependency testing · Platforms: Java 17\+, Docker, Kubernetes · Region: Version, runtime and trusted development/test environment requirements apply\.

### Untrusted public deployment — unsupported

Project security policy restricts use to trusted development/test environments\.[^mockserver-security]

Use case: Programmatic service dependency testing · Platforms: Java 17\+, Docker, Kubernetes · Region: Version, runtime and trusted development/test environment requirements apply\.

### [Substitute for WireMock](/wiremock) — limited

Can replace programmable HTTP mocks and record/replay fixtures; expectations, persistence and matching behavior require migration\.[^mockserver-readme][^mockserver-record][^wiremock-standalone]

Use case: Programmatic service dependency testing · Platforms: Java 17\+, Docker, Kubernetes · Region: Version, runtime and trusted development/test environment requirements apply\.

## References

[^mockserver-license]: [MockServer license](<https://github.com/mock-server/mockserver-monorepo/blob/master/LICENSE.md>) — Apache License 2\.0 (vendor; retrieved 2026-10-07T11:09:34Z)

[^mockserver-readme]: [MockServer repository](<https://github.com/mock-server/mockserver-monorepo/blob/master/README.md>) — Request matching, fault injection, distribution and Java requirements (vendor; retrieved 2026-10-07T11:09:23Z)

[^mockserver-record]: [MockServer record and replay](<https://www.mock-server.com/proxy/record_and_replay.html>) — Plain retrieval versus recordings/promote: consolidation, parameterization and redaction defaults; checked 2026\-10\-14\. (vendor; retrieved 2026-10-14T04:23:47Z)

[^mockserver-persist]: [Persisting MockServer expectations](<https://www.mock-server.com/mock_server/persisting_expectations.html>) — Separate persistence controls for authored and recorded expectations (vendor; retrieved 2026-10-07T11:08:28Z)

[^mockserver-security]: [MockServer security policy](<https://github.com/mock-server/mockserver-monorepo/blob/master/SECURITY.md>) — Development/testing\-only posture and trusted environment assumptions (vendor; retrieved 2026-10-07T11:09:34Z)

[^wiremock-standalone]: [WireMock standalone service](<https://wiremock.org/docs/standalone/>) — Java/JSON configuration and JAR/container distribution (vendor; retrieved 2026-10-07T11:08:23Z)

[^wiremock-record]: [WireMock record and playback](<https://wiremock.org/docs/record-playback/>) — Recording and snapshotting stub mappings (vendor; retrieved 2026-10-07T11:08:23Z)

Source revision: https://substitutefor.net/entities/Q1683?revision=1796
