CacheManager { public long processCacheAnnotations(Method nonProxiedMethod, List<String> parameters) { if (isJsCached(nonProxiedMethod)) { return jsCacheAnnotationServices.getJsCacheResultDeadline(nonProxiedMethod.getAnnotation(JsCacheResult.class)); } return 0L; }  long processCacheAnnotations(Method nonProxiedMethod, List<String> parameters);  }
@Test public void testProcessCacheAnnotations() throws NoSuchMethodException { System.out.println("processCacheAnnotations"); Method method = CacheAnnotedClass.class.getMethod("jsCacheResultAnnotatedMethod"); doReturn(false).doReturn(true).when(instance).isJsCached(any(Method.class)); when(jsCacheAnnotationServices.getJsCacheResultDeadline(any(JsCacheResult.class))).thenReturn(6L); long result = instance.processCacheAnnotations(method, null); assertThat(result).isEqualTo(0L); result = instance.processCacheAnnotations(method, null); assertThat(result).isEqualTo(6L); }