Mock Scenario Editor
Not included in DVARA Open Source.
The Mock Scenario Editor is the browser-based surface in DVARA Flightdeck for authoring the Groovy scenarios that drive the Mock Provider. It gives you an inline editor, a shape check on save, and a Run test panel that tries a scenario against a sample request on a Gateway, without touching the Gateway's live matcher list.
This page covers the Flightdeck-side of the workflow. For scenario syntax (the name, when, respond variables), the file layout, and the matcher precedence rules, see the Mock Provider page.
Flightdeck no longer runs the Mock provider or Groovy. Save checks a scenario's shape without running it, and Run test runs on a Gateway. The editor's settings moved to dvara.flightdeck.mock-authoring.*, and Flightdeck refuses to start with dvara.llm-gateway.providers.mock.enabled=true. See Upgrading to 1.16.0.
Prerequisites
The editor is a local developer tool and is off by default. Scenarios are Groovy code, and a Gateway that runs one executes it inside its JVM, so turn the editor on only where that is acceptable.
All three of the following must hold on Flightdeck for the /mock-scenarios pages to appear (there is no separate REST API):
| Requirement | Why |
|---|---|
dvara.flightdeck.mock-authoring.enabled=true (DVARA_FLIGHTDECK_MOCKAUTHORING_ENABLED) | Explicit opt-in for the editor pages. Defaults to false. |
dvara.flightdeck.mock-authoring.scenarios-dir=<path> (DVARA_FLIGHTDECK_MOCKAUTHORING_SCENARIOSDIR) | The folder the editor reads and writes. Every editor page answers 404 while it is not set or is not a folder. |
Flightdeck is not running with the prod or production Spring profile | The editor and its Settings link are never served under those profiles. |
For Run test, at least one Gateway must run the Mock provider and allow scenario tests:
| Gateway setting | Why |
|---|---|
dvara.llm-gateway.providers.mock.enabled=true (MOCK_PROVIDER_ENABLED) | The Gateway runs the Mock provider. |
dvara.data-plane.control-plane.jobs.mock-scenario-test.enabled=true (DVARA_DATA_PLANE_CONTROL_PLANE_JOBS_MOCK_SCENARIO_TEST_ENABLED) | The Gateway accepts scenario tests from Flightdeck. Defaults to false. |
Every page and action of the editor requires the owner role. The Gateway also logs a loud WARN at startup whenever the Mock provider is enabled on a non-dev Spring profile, so the activation is never silent.
Enabling the editor
Set the two Flightdeck properties in Flightdeck's override config:
dvara:
flightdeck:
mock-authoring:
enabled: true
scenarios-dir: /app/config/mock-scenarios
Mount the scenarios folder into Flightdeck. A Gateway serves the scenarios you write only if you give it the same folder as its dvara.llm-gateway.providers.mock.scenarios-dir, or deploy the files to it through your normal pipeline. After restart, DVARA Flightdeck serves three routes:
/mock-scenarios— list page showing every.groovyfile in the scenarios folder with its filename, size, and last-modified timestamp/mock-scenarios/new— blank editor with a starter template/mock-scenarios/{filename}/edit— editor pre-loaded with the on-disk source


Editing a scenario
The editor uses these owner-only operations: PUT /mock-scenarios/{filename} creates or replaces a scenario, DELETE /mock-scenarios/{filename} deletes it, and POST /mock-scenarios/{filename}/test runs a test. Use a basename of letters, digits, dashes and underscores, optionally ending in .groovy; path separators are refused.
The editor provides Groovy syntax highlighting and a single Save action.
Before Save writes the file, Flightdeck checks the scenario's shape without running it: the name, the size (at most 56 KiB), and that the source defines when = { request -> ... } and respond = { request -> ... }. A scenario that fails the check is refused with MOCK_SCENARIO_INVALID or MOCK_SCENARIO_TOO_LARGE, shown as an inline error banner, and the existing file on disk is left untouched. Save does not compile the Groovy; Run test checks the rest on a Gateway.
The Run test panel
The right-hand pane is a sample-request builder with fields for:
model— anymock/*string the scenario might match onuserMessage— the text that populates the latest user messagesystemMessage(optional) — prepended as asystemrole messagetemperature— nullable, defaults to the provider default if left blankstream— checkbox that setsrequest.stream=true
Click Run test and Flightdeck sends the editor's current text, saved or not, with the sample request to every Gateway cluster. On each cluster, a Gateway that runs scenario tests loads the text in a temporary folder, runs when and respond against the sample, and returns the outcome. The editor shows one line per cluster:
| Badge | Meaning |
|---|---|
| Matched | The when predicate returned true. The editor renders the response body from respond() plus the elapsed evaluation time. |
| No match | The when predicate returned false. The editor shows the elapsed time so you can spot slow predicates. |
| Error | The scenario did not compile, or the predicate or the response closure threw. The editor shows the message so you can identify the bug without grepping logs. |
| Not tested | The cluster has no connected Gateway that runs scenario tests. The editor says why. |
Run test writes nothing. It does not save the file, change any Gateway's active matcher list, or change any file on disk. Run it as many times as you want while iterating.
Deleting a scenario
The list page's Delete button removes the file from Flightdeck's scenarios folder. A Gateway that mounts the same folder drops the scenario when its filesystem watcher sees the delete. As with saves, the action is owner-only.
Audit events
Every change to a scenario file emits a signed audit event so scenario changes are traceable:
| Event | Trigger |
|---|---|
MOCK_SCENARIO_CREATED | A scenario file was created via the editor (PUT on a filename that didn't exist). |
MOCK_SCENARIO_UPDATED | An existing scenario file was overwritten via the editor. |
MOCK_SCENARIO_DELETED | A scenario file was deleted via the editor. |
MOCK_SCENARIO_RELOADED | A Gateway reloaded its scenarios folder, on a filesystem-watcher event. |
A Run test has no event of its own. It is recorded by the Gateway job events, with the scenario source as the job's input.
Upgrading to 1.16.0
- On Flightdeck, replace
dvara.llm-gateway.providers.mock.console-authoringwithdvara.flightdeck.mock-authoring.enabled, anddvara.llm-gateway.providers.mock.scenarios-dirwithdvara.flightdeck.mock-authoring.scenarios-dir. The old names no longer apply on Flightdeck. - Remove
dvara.llm-gateway.providers.mock.enabled(MOCK_PROVIDER_ENABLED) from Flightdeck. Flightdeck refuses to start with it on, and the message names the new setting. - On the Gateways that should run tests, set
dvara.data-plane.control-plane.jobs.mock-scenario-test.enabled=true. - Scenarios larger than 56 KiB are refused by Save and Run test; the cap was 256 KiB.
When to use the editor vs the filesystem
Use the editor for:
- Interactive development — fast iteration on matcher logic against a running Gateway, without restarts
- One-off ad-hoc scenarios — quick spikes to reproduce a tester's bug report
- Exploratory debugging — running the same scenario against a variety of synthetic requests via the Run test panel
Keep scenarios in version control and deploy them from the filesystem for:
- Production mock environments — CI pipelines, staging, shared dev instances
- Anything that must be reviewable via a pull request — compliance-sensitive test fixtures, shared fixtures across team boundaries
- Any environment where you want to disable editing entirely — leave
dvara.flightdeck.mock-authoring.enabled=falseand the editor routes return 404
The two modes coexist: a scenario authored in the editor is a plain file in Flightdeck's scenarios folder, ready to git-commit and promote through your normal deploy pipeline.
Next steps
- Mock Provider — scenario syntax, matcher precedence, file layout, hot-reload mechanics
- SIEM & Webhooks — route the
MOCK_SCENARIO_*audit events to your SIEM if you want change tracking outside the gateway