corda / net.corda.testing.node / TestClock

TestClock

@ThreadSafe class TestClock : MutableClock

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

Constructors

<init>

TestClock(delegateClock: Clock)

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

Functions

advanceBy

fun advanceBy(duration: Duration): Unit

Advance this Clock by the specified Duration for testing purposes.

setTo

fun setTo(newInstant: Instant): Unit

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.

Extension Functions

contextLogger

fun Any.contextLogger(): Logger

When called from a companion object, returns the logger for the enclosing class.