control

control the server clock for deterministic time-based testing

Freeze, advance, or reset MockServer's internal clock. The controllable clock affects response template date/time helpers (now_iso_8601, now_epoch, now_rfc_1123, dates.*) and expectation TimeToLive expiry. Event-log timestamps and JWT issuance are not affected.

put/mockserver/clock

Request

  • Base URL: http://localhost:1080
  • URL: http://localhost:1080/mockserver/clock
  • Auth: none declared

Request body

action'freeze' | 'advance' | 'reset' required

freeze: freeze the clock at the given instant (or current time if instant is omitted); advance: advance the frozen clock by durationMillis (freezes first if not already frozen); reset: reset the clock to real wall-clock time

instantstring date-time

ISO-8601 instant to freeze at (only used with action 'freeze'; omit to freeze at current time)

durationMillisinteger

number of milliseconds to advance the clock by (required when action is 'advance')

Response

clock action applied successfully

statusstring

the action that was performed (freeze, advance, or reset)

currentInstantstring date-time

the current server clock instant after the action

currentEpochMillisinteger

the current server clock time as epoch milliseconds after the action

Changes

No recorded changes to this operation across all 1 revision of this API.