Package org.openbravo.cache
Class FakeTicker
- java.lang.Object
-
- org.openbravo.cache.FakeTicker
-
- All Implemented Interfaces:
com.github.benmanes.caffeine.cache.Ticker
public class FakeTicker extends Object implements com.github.benmanes.caffeine.cache.Ticker
Fake ticker implementation that allows testing ticker sensitive cache. Includes a current time in nanoseconds and allows advancing it by a given amount of time.
-
-
Constructor Summary
Constructors Constructor Description FakeTicker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
advance(Duration duration)
Advances the fake timer by a given duration.long
read()
-
-
-
Method Detail
-
read
public long read()
- Specified by:
read
in interfacecom.github.benmanes.caffeine.cache.Ticker
-
advance
public void advance(Duration duration)
Advances the fake timer by a given duration. The duration is transformed into nanoseconds- Parameters:
duration
- - Duration to advance the fake timer
-
-