How to use 'Fake Ticker' with Caffeine? #810
-
In your discussion of testing here you suggest that we use guava-testing's 'FakeTicker' class. Unfortunately, when I try to use this I get an error of incompatible types. Your Caffeine.ticker method is looking for a caffeine.cache.Ticker and FakeTicker is a google.common.base.Ticker, can you please tell me how I can use a fake ticker with caffeine? I didn't see any sort of constructor / builder / converter method that took a google ticker and transformed to a caffeine ticker but perhaps I've missed something. Really need this as having to use a Thread.sleep in a unit test is a no no :) Error: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You missed the method reference to adapt. =)
|
Beta Was this translation helpful? Give feedback.
You missed the method reference to adapt. =)