use of com.github.benmanes.caffeine.cache.Ticker in project caffeine by ben-manes.
the class CacheBuilderTest method testTicker_setTwice.
public void testTicker_setTwice() {
Ticker testTicker = Ticker.systemTicker();
Caffeine<Object, Object> builder = Caffeine.newBuilder().ticker(testTicker);
try {
// even to the same instance is not allowed
builder.ticker(testTicker);
fail();
} catch (IllegalStateException expected) {
}
}
Aggregations