API Mocking and Stubbing Flashcards
7 cards from real API practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 7 API Mocking and Stubbing flashcards as text
Which tool is commonly used to create a full fake REST API using only a JSON file as its data source?
Answer: JSON Server
JSON Server creates a complete fake REST API from a JSON file with zero backend code, making it ideal for rapid mock server setup during development.
In WireMock, what is a 'stub mapping'?
Answer: A configuration that defines the request criteria to match and the response WireMock should return
A WireMock stub mapping specifies the request matching rules (URL pattern, HTTP method, headers, body) and the corresponding response to return when a request matches.
What does 'request matching' mean in the context of API mock servers?
Answer: The process by which a mock server evaluates incoming request attributes to determine which configured response to return
Request matching is how mock servers evaluate attributes of an incoming request—such as URL, method, headers, and body—against configured rules to select the appropriate canned response.
What is 'response templating' in API mocking tools such as WireMock?
Answer: Dynamically constructing mock responses by injecting values extracted from the incoming request
Response templating allows mock servers to build dynamic responses using data from the incoming request, such as path parameters, query strings, or request body fields.
Which Postman feature enables you to simulate an API server and return predefined responses without a real backend?
Answer: Postman Mock Server
Postman Mock Servers use saved response examples within a collection to create a hosted simulated API that returns predefined responses to incoming requests.
What is the purpose of the 'record and replay' feature found in API mocking tools?
Answer: Capturing real HTTP interactions with an actual API and replaying them as mock responses in subsequent tests
Record and replay captures live HTTP traffic from a real API and uses those recordings as mock responses, ensuring that mock data is realistic and matches actual API behavior.
In Mockoon, what is a 'route'?
Answer: A defined endpoint with request matching rules and a configured response within the mock server
In Mockoon, a route is the fundamental building block of a mock server, representing a configured endpoint that matches specific incoming requests and returns a defined mock response.