TestClock

class TestClock(delegateClock: Clock)

A Clock that can have the time advanced for use in testing.

Constructors

Link copied to clipboard
constructor(delegateClock: Clock)

Functions

Link copied to clipboard
fun advanceBy(duration: Duration)

Advance this Clock by the specified Duration for testing purposes.

Link copied to clipboard
fun setTo(newInstant: Instant)

Move this Clock to the specified Instant for testing purposes. This will only be approximate due to the time ticking away, but will be some time shortly after the requested Instant.