Class MockoonImporter

java.lang.Object
org.mockserver.imports.MockoonImporter

public class MockoonImporter extends Object
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 by responseMode:
  • null / rules-based (the default) — each response's rules become extra request matchers, and one expectation is emitted per response with a descending priority so the array order is preserved and the default response 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.RANDOM multi-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.