Class CurrentTime

java.lang.Object
io.strimzi.kafka.oauth.services.CurrentTime

public class CurrentTime extends Object
The source of time used in several places instead of java.lang.System.currentTime. It allows overriding the source of time for tests.
  • Constructor Details

    • CurrentTime

      public CurrentTime()
  • Method Details

    • setCurrentTimeProvider

      public static void setCurrentTimeProvider(CurrentTimeProvider timeProvider)
      Set the current time provider
      Parameters:
      timeProvider - the CurrentTimeProvider instance
    • getCurrentTimeProvider

      public static CurrentTimeProvider getCurrentTimeProvider()
      Get the currently set CurrentTimeProvider
      Returns:
      The current CurrentTimeProvider
    • currentTime

      public static long currentTime()
      Get current time in millis
      Returns:
      Current time in millis provided by current CurrentTimeProvider