Class InternalSystemClock

java.lang.Object
net.serenitybdd.core.time.InternalSystemClock
All Implemented Interfaces:
SystemClock

public class InternalSystemClock
extends java.lang.Object
implements SystemClock
Object that encapsulates system clock operations.
  • Constructor Summary

    Constructors
    Constructor Description
    InternalSystemClock()  
  • Method Summary

    Modifier and Type Method Description
    java.time.ZonedDateTime getCurrentTime()
    Find the current system time.
    void pauseFor​(long timeInMilliseconds)
    Pause execution for the requested delay.
    protected void sleepFor​(long timeInMilliseconds)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • InternalSystemClock

      public InternalSystemClock()
  • Method Details

    • pauseFor

      public void pauseFor​(long timeInMilliseconds)
      Pause execution for the requested delay. Throws a runtime exception if something goes wrong.
      Specified by:
      pauseFor in interface SystemClock
    • sleepFor

      protected void sleepFor​(long timeInMilliseconds) throws java.lang.InterruptedException
      Throws:
      java.lang.InterruptedException
    • getCurrentTime

      public java.time.ZonedDateTime getCurrentTime()
      Find the current system time.
      Specified by:
      getCurrentTime in interface SystemClock