class TestClock : MutableClock, SerializeAsTokenA Clock that can have the time advanced for use in testing.
| <init> |
TestClock(delegateClock: Clock = Clock.systemUTC())A Clock that can have the time advanced for use in testing. |
| mutationCount |
val mutationCount: LongThis tracks how many direct mutations of "now" have occured for this Clock, but not the passage of time. |
| mutations |
val mutations: <ERROR CLASS><Long>This is an observer on the mutation count of this Clock, which reflects the occurence of mutations. |
| advanceBy |
fun advanceBy(duration: Duration): UnitAdvance this Clock by the specified Duration for testing purposes. |
| getZone |
fun getZone(): ZoneId |
| instant |
fun instant(): Instant |
| setTo |
fun setTo(newInstant: Instant): UnitMove this Clock to the specified Instant for testing purposes. |
| toToken |
fun toToken(context: SerializeAsTokenContext): SerializationToken |
| withZone |
fun |
| notifyMutationObservers |
fun notifyMutationObservers(): UnitMust be called by subclasses when they mutate (but not just with the passage of time as per the "wall clock"). |
| awaitWithDeadline |
fun Clock.awaitWithDeadline(deadline: Instant, future: Future<*> = SettableFuture<Any>()): BooleanWait until the given Future is complete or the deadline is reached, with support for MutableClock implementations used in demos or testing. This will also substitute a Fiber compatible Future if required. |