Search in sources :

Example 1 with Ticker

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) {
    }
}
Also used : Ticker(com.github.benmanes.caffeine.cache.Ticker)

Aggregations

Ticker (com.github.benmanes.caffeine.cache.Ticker)1