MutableClock

class MutableClock(startMillis: Long = START) : Clock

A clock that stands still until a test moves it, so a test decides when leases and reservations expire.

Constructors

Link copied to clipboard
constructor(startMillis: Long = START)

Properties

Link copied to clipboard
open override val zone: ZoneId

Functions

Link copied to clipboard
fun advance(by: Duration)
Link copied to clipboard
open override fun getZone(): ZoneId
Link copied to clipboard
open override fun instant(): Instant
Link copied to clipboard
open override fun millis(): Long
Link copied to clipboard
fun set(millis: Long)

Sets the clock to millis, an earlier time included: a test reads a store as it stood then, where a record the store deleted is missing and one it kept shows.

Link copied to clipboard
open override fun withZone(zone: ZoneId): Clock