Package org.mockserver.imports
Class MockoonImporter
java.lang.Object
org.mockserver.imports.MockoonImporter
Imports MockServer expectations from a Mockoon environment
JSON export.
Each Mockoon route maps to one or more expectations. The route method and
endpoint (with :param segments converted to single-segment regex matchers) form
the request matcher; each route response supplies status code, headers, body and a
latency → delay mapping.
Multiple responses per route
A Mockoon route can hold several responses selected byresponseMode:
- null / rules-based (the default) — each response's
rulesbecome extra request matchers, and one expectation is emitted per response with a descending priority so the array order is preserved and thedefaultresponse acts as the lowest-priority catch-all. - SEQUENTIAL — one cycling multi-response expectation
(
ResponseMode.SEQUENTIAL); rules are ignored (with a warning if present). - RANDOM — one
ResponseMode.RANDOMmulti-response expectation. - DISABLE_RULES / FALLBACK — approximated (first/default response served); a warning documents the boundary.
Rule targets/operators without a MockServer equivalent (cookie/path/number targets, the
null/empty_array operators, OR-combined rules) are reported as
ImportWarnings rather than silently dropped.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionimportExpectations(String environmentJson) importExpectations(String environmentJson, ImportRedaction.Options redactionOptions)
-
Constructor Details
-
MockoonImporter
public MockoonImporter()
-
-
Method Details
-
importExpectations
-
importExpectations
public ImportResult importExpectations(String environmentJson, ImportRedaction.Options redactionOptions)
-