Package org.mockserver.mock
Class CassetteRegistry
java.lang.Object
org.mockserver.mock.CassetteRegistry
Process-wide registry of known cassettes — fixture files of MockServer expectations
recorded with
record_llm_fixtures or loaded with load_expectations_from_file.
The dashboard's Cassettes tab keeps a per-browser list in localStorage; this registry
is the server-side counterpart so cassettes are also discoverable across page reloads, across
browsers, and from automation (e.g. the demo data loader). It holds only lightweight metadata —
the cassette's file path, name, expectation count and how it was created — never the file
contents themselves. State is held in a ConcurrentHashMap keyed by file path and is
cleared on server reset (see HttpState.reset()).
Exposed over the control plane as GET/PUT/DELETE /mockserver/cassettes.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CassetteRegistrylist()Snapshot of all registered cassettes, most-recently-used first.Register (or update) a cassette, stamping itslastUsedwith the current time.booleanRemove a cassette by path.voidreset()Clear all cassettes.
-
Constructor Details
-
CassetteRegistry
-
-
Method Details
-
getInstance
-
register
public CassetteRegistry.Entry register(String path, String filename, int expectationCount, String origin) Register (or update) a cassette, stamping itslastUsedwith the current time. When a cassette with the samepathalready exists it is updated in place rather than duplicated. No-op ifpathis blank.- Parameters:
origin- how the cassette was created —"recorded"or"loaded"- Returns:
- the stored entry, or
nullifpathwas blank
-
remove
Remove a cassette by path. Returns true if one was removed. -
list
Snapshot of all registered cassettes, most-recently-used first. -
reset
public void reset()Clear all cassettes. Called on server reset and for test isolation.
-