Exemplo 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();
 }
Exemplo n.º 2
0
 @Test
 public void testCaching() throws Exception {
   cachedCallable.call();
   cachedCallable.call();
   verify(inner, times(1)).call();
 }
Exemplo n.º 3
0
 @Test
 public void testCall() throws Exception {
   assertEquals((long) cachedCallable.call(), CALL_RESULT);
 }