liveBook · Manning

Server mocking library

As explained in Secure APIs

A mock server is a server that simulates an API's specified behavior for development and testing.

A server mocking library creates a mock server that replicates an API’s specified behavior. It gives developers a simulated backend before the real server is ready. section 3.6

With an API specification in place, client and server work can proceed in parallel. The client uses the mock server, while the implementation is validated against the specification. section 3.6

Common server mocking libraries include:

Figure 3.27 When we produce an API specification, we can work on the API client and the server in parallel. We simulate the backend using mock servers while we work on the client, and we validate the server implementation against the specification to ensure that the integration works.
figure

Shows how a mock server simulates the backend for client development while the real server is checked against the API specification. section 3.6

How Secure APIs covers it

How deep it goes
Defines the behavior and workflow, but defers detailed implementation and usage guidance.
Examples
Uses Prism, WireMock, and Microcks, plus a parallel client-server workflow shown with a simulated backend.
What it assumes
Assumes an API specification exists and distinguishes the API client from the API server.
What you can do after
Apply it via Prism, WireMock, or Microcks to develop clients early and validate server integration against an API specification.
How it connects
Connects API specifications with API clients, API servers, SDK generation, and continuous integration testing.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Secure APIs. The section links point to the parts of the book it draws on.