Package it.tidalwave.util.test
Class MockTimeProvider
- java.lang.Object
-
- it.tidalwave.util.test.MockTimeProvider
-
- All Implemented Interfaces:
TimeProvider
,java.util.function.Supplier<java.time.Instant>
public class MockTimeProvider extends java.lang.Object implements TimeProvider
A mock implementation ofTimeProvider
which returns a fixed value that can be set (the zero epoch instant by default).- Since:
- 1.39
- Author:
- Fabrizio Giudici
- See Also:
TimeProvider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface it.tidalwave.util.TimeProvider
TimeProvider.DefaultTimeProvider
-
-
Field Summary
-
Fields inherited from interface it.tidalwave.util.TimeProvider
__INSTANCE
-
-
Constructor Summary
Constructors Constructor Description MockTimeProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.time.Instant
currentInstant()
Returns the current time.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface it.tidalwave.util.TimeProvider
currentLocalDateTime, currentZonedDateTime, get
-
-
-
-
Method Detail
-
currentInstant
@Nonnull public java.time.Instant currentInstant()
Description copied from interface:TimeProvider
Returns the current time.- Specified by:
currentInstant
in interfaceTimeProvider
- Returns:
- the current time as an
Instant
-
-