Class MockCircularTime

  • All Implemented Interfaces:
    Time

    public class MockCircularTime
    extends java.lang.Object
    implements Time
    A mock time that takes a list of synthetic timestamps in MS and return them one by one in a circular manner.
    • Constructor Detail

      • MockCircularTime

        public MockCircularTime​(java.util.List<java.lang.Long> timestampsInMs)
    • Method Detail

      • getCurrentDate

        public java.util.Date getCurrentDate()
      • getMilliseconds

        public long getMilliseconds()
        Specified by:
        getMilliseconds in interface Time
      • getNanoseconds

        public long getNanoseconds()
        Specified by:
        getNanoseconds in interface Time
      • getSeconds

        public int getSeconds()
      • sleep

        public void sleep​(long ms)
                   throws java.lang.InterruptedException
        Specified by:
        sleep in interface Time
        Throws:
        java.lang.InterruptedException