Class MockSleeper

  • All Implemented Interfaces:
    Sleeper

    @Beta
    public class MockSleeper
    extends Object
    implements Sleeper
    Beta
    Mock for Sleeper.

    Implementation is not thread-safe.

    Since:
    1.15
    Author:
    Yaniv Inbar
    • Constructor Detail

      • MockSleeper

        public MockSleeper()
    • Method Detail

      • sleep

        public void sleep​(long millis)
                   throws InterruptedException
        Description copied from interface: Sleeper
        Causes the currently executing thread to sleep (temporarily cease execution) for the specified number of milliseconds as specified in Thread.sleep(long).
        Specified by:
        sleep in interface Sleeper
        Parameters:
        millis - length of time to sleep in milliseconds
        Throws:
        InterruptedException - if any thread has interrupted the current thread
      • getCount

        public final int getCount()
        Returns the number of times sleep(long) was called.
      • getLastMillis

        public final long getLastMillis()
        Returns the value of millis parameter when sleep(long) was last called or 0 if not called.