Class BatchClock
java.lang.Object
io.jenkins.plugins.batchcontrol.store.BatchClock
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public final class BatchClock
extends Object
Single source of time for the whole plugin. All time reads go through this holder so tests
can install a fixed
Clock instead of manipulating the system clock or waiting on timers.-
Method Summary
Modifier and TypeMethodDescriptionstatic Clockclock()The current clock (system default zone unless a test installed another one).static Instantnow()Current instant according toclock().static voidreset()Restores the system default zone clock.static voidsetForTest(Clock testClock) Installs a fixed/offset clock for tests.