Class MockTimeProvider

  • All Implemented Interfaces:
    TimeProvider, java.util.function.Supplier<java.time.Instant>

    public class MockTimeProvider
    extends java.lang.Object
    implements TimeProvider
    A mock implementation of TimeProvider which returns a fixed value that can be set (the zero epoch instant by default).
    Since:
    1.39
    Author:
    Fabrizio Giudici
    See Also:
    TimeProvider
    • Constructor Detail

      • MockTimeProvider

        public MockTimeProvider()
    • Method Detail

      • currentInstant

        @Nonnull
        public java.time.Instant currentInstant()
        Description copied from interface: TimeProvider
        Returns the current time.
        Specified by:
        currentInstant in interface TimeProvider
        Returns:
        the current time as an Instant