Class MonotonicFakeClock

java.lang.Object
org.eclipse.jgit.junit.time.MonotonicFakeClock
All Implemented Interfaces:
org.eclipse.jgit.util.time.MonotonicClock

public class MonotonicFakeClock extends Object implements org.eclipse.jgit.util.time.MonotonicClock
Fake MonotonicClock for testing code that uses Clock.
Since:
4.6
  • Constructor Details

    • MonotonicFakeClock

      public MonotonicFakeClock()
  • Method Details

    • tick

      public void tick(long add, TimeUnit unit)
      Advance the time returned by future calls to propose().
      Parameters:
      add - amount of time to add; must be > 0.
      unit - unit of add.
    • propose

      public org.eclipse.jgit.util.time.ProposedTimestamp propose()
      Specified by:
      propose in interface org.eclipse.jgit.util.time.MonotonicClock