@Test public void validCacheHit() throws Throwable { Assume.assumeTrue(isValid); when(cache.get(eq(cacheKey), any(SerializationType.class))).thenReturn(expectedValue); assertEquals(expectedValue, advice.cacheGetSingle(pjp)); verify(cache).get(eq(cacheKey), any(SerializationType.class)); verify(cache, never()).set(anyString(), anyInt(), any(), any(SerializationType.class)); verify(pjp, never()).proceed(); }
@Around("getSingle()") public Object cacheGetSingle(final ProceedingJoinPoint pjp) throws Throwable { return cache(pjp); }
ReadThroughSingleCacheAdvice extends SingleReadCacheAdvice<ReadThroughSingleCache> { @Around("getSingle()") public Object cacheGetSingle(final ProceedingJoinPoint pjp) throws Throwable { return cache(pjp); } }
ReadThroughSingleCacheAdvice extends SingleReadCacheAdvice<ReadThroughSingleCache> { @Around("getSingle()") public Object cacheGetSingle(final ProceedingJoinPoint pjp) throws Throwable { return cache(pjp); } ReadThroughSingleCacheAdvice(); }
ReadThroughSingleCacheAdvice extends SingleReadCacheAdvice<ReadThroughSingleCache> { @Around("getSingle()") public Object cacheGetSingle(final ProceedingJoinPoint pjp) throws Throwable { return cache(pjp); } ReadThroughSingleCacheAdvice(); @Pointcut("@annotation(com.google.code.ssm.api.ReadThroughSingleCache)") void getSingle(); @Around("getSingle()") Object cacheGetSingle(final ProceedingJoinPoint pjp); }
ReadThroughSingleCacheAdvice extends SingleReadCacheAdvice<ReadThroughSingleCache> { @Around("getSingle()") public Object cacheGetSingle(final ProceedingJoinPoint pjp) throws Throwable { return cache(pjp); } ReadThroughSingleCacheAdvice(); @Pointcut("@annotation(com.google.code.ssm.api.ReadThroughSingleCache)") void getSingle(); @Around("getSingle()") Object cacheGetSingle(final ProceedingJoinPoint pjp);  }