Esempio n. 1
0
 @Test
 public void testTtl() throws Exception {
   cachedCallable.call();
   cachedCallable.call();
   verify(inner, times(1)).call();
   mockTime.addMilliseconds(1001);
   when(inner.call()).thenReturn(CALL_RESULT + 1l);
   assertEquals((long) cachedCallable.call(), CALL_RESULT + 1l);
   verify(inner, times(2)).call();
 }
Esempio n. 2
0
 @Test
 public void testCaching() throws Exception {
   cachedCallable.call();
   cachedCallable.call();
   verify(inner, times(1)).call();
 }
Esempio n. 3
0
 @Test
 public void testCall() throws Exception {
   assertEquals((long) cachedCallable.call(), CALL_RESULT);
 }