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]
Contents 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]
Also included: 3 capabilities and 0 substitute relationships. Check substitutes in section 1 and capabilities in section 3.