Skip to documentation

Concept · Runtime model

Available

From a definition to a real response

DotMock separates authored behavior from live execution. You configure a protocol workspace, preview it with the real runtime, publish it, and inspect what happened without turning every test into application code.

In this guide

  • Know where definitions, live values, and traffic belong
  • Understand the exact request execution order
  • Choose dry-run or live execution intentionally
  • Use the dashboard, CLI, and MCP against the same contract
On this page

A workspace owns one mock surface

Create a REST, GraphQL, SOAP, gRPC, LLM, or webhook workspace in the dashboard. Each workspace keeps its protocol definition, operations, state resources, tester context, traffic, and settings together.

Specialized workspaces retain native contracts: WSDL and XSD for SOAP, protobuf descriptors for gRPC, and SDL for GraphQL.

Configuration and runtime data are separate

Definitions, snapshots, and audit records are durable control-plane data. Live state values use API-isolated namespaces. Publishing a configuration changes how future requests execute; it does not erase live values.

An initial state value is a seed for new or reset entries. It is not an implicit migration of data that already exists.

Every request follows one order

The runtime first selects the matching operation and conditional response. Before actions and inline template mutations then run in one atomic transaction. Only after rendering succeeds is the response returned. Durable after actions run last and cannot change the selected response.

text
Match → Before actions → Template rendering → Response → After actions

Templates preserve JSON types

An exact helper expression can return an object, array, number, boolean, or null. An expression embedded in surrounding text becomes a string. This is why a state-backed GET should usually return the lookup directly, while a field such as order-{{uuid}} is intentionally text.

Typed object
{{state.get "users-by-id" "$param.userId" "" null}}

Embedded string
{
  "reference": "user-{{param \"userId\"}}"
}

Preview safely, then exercise the live URL

Dry-run uses the real matcher, renderer, and state overlay, but saves nothing and performs no delivery, proxy, or callout. The result identifies the winning operation, separated status/body/headers, diagnostics, and the exact proposed state diff.

Live requests use the published protocol endpoint and persist approved effects. Inspect traffic, state, webhook deliveries, and audit history after the request rather than inferring success from a 2xx alone.

Use the same system from every tool

The dashboard is the visual authoring and inspection surface. The CLI covers creation, testing, state, traffic, webhook listeners, and CI-friendly JSON output. MCP gives coding agents scoped inspection and draft-aware edits with approvals for destructive actions.

  • Dashboard — author, test, publish, inspect, and manage live values
  • CLI — automate repeatable workflows and forward webhook deliveries locally
  • MCP — let an agent inspect context, propose a patch, test it, and apply approved changes
  • Mock URL — serve the published REST, GraphQL, gRPC, LLM, or protocol behavior to a real client