test_class.file: guja-core/src/test/java/com/wadpam/guja/cache/annotations/CacheRemoveAllMethodInterceptorTest.java
test_class.identifier: CacheRemoveAllMethodInterceptorTest
test_class.superclass: extends CachePutMethodInterceptorTest
test_case.body: @Test
    public void testInvoke() throws Exception {
  
      final String parentKey = null;
  
      expect(mockDao.put(parentKey, 1L, "1")).andReturn(1L).once();
      expect(mockDao.get(parentKey, 1L)).andReturn(null).once();
      expect(mockDao.put(parentKey, 1L, "1")).andReturn(1L).once();
  
      replay(mockDao);
  
      Long id = dao.put(parentKey, 1L, "1");
      assertTrue(id.equals(1L));
  
      String value = dao.get(parentKey, 1L);
      assertTrue("1".equals(value));
  
      dao.removeAll();
  
      value = dao.get(parentKey, 1L);
      assertTrue(null == value);
  
      value = dao.get(parentKey, 1L);
      assertTrue(null == value);
  
      id = dao.put(parentKey, 1L, "1");
      assertTrue(id.equals(1L));
  
      value = dao.get(parentKey, 1L);
      assertTrue("1".equals(value));
  
    }
test_case.class_method_signature: CacheRemoveAllMethodInterceptorTest.testInvoke()
test_case.full_signature: @Test public void testInvoke()
test_case.identifier: testInvoke
test_case.invocations: once andReturn expect put once andReturn expect get once andReturn expect put replay put assertTrue equals get assertTrue equals removeAll get assertTrue get assertTrue put assertTrue equals get assertTrue equals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testInvoke()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(CacheRemoveAllMethodInterceptor.class)
focal_class.modifier: static final
focal_class.original_string: static final Logger LOGGER = LoggerFactory.getLogger(CacheRemoveAllMethodInterceptor.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.file: guja-core/src/main/java/com/wadpam/guja/cache/annotations/CacheRemoveAllMethodInterceptor.java
focal_class.identifier: CacheRemoveAllMethodInterceptor
focal_class.class_method_signature: CacheRemoveAllMethodInterceptor.CacheRemoveAllMethodInterceptor(Provider<CacheResolver> cacheResolverProvider, Provider<CacheKeyGenerator> defaultCacheKeyGeneratorProvider)
focal_class.full_signature: @Inject public  CacheRemoveAllMethodInterceptor(Provider<CacheResolver> cacheResolverProvider, Provider<CacheKeyGenerator> defaultCacheKeyGeneratorProvider)
focal_class.identifier: CacheRemoveAllMethodInterceptor
focal_class.modifiers: @Inject public
focal_class.parameters: (Provider<CacheResolver> cacheResolverProvider, Provider<CacheKeyGenerator> defaultCacheKeyGeneratorProvider)
focal_class.signature:  CacheRemoveAllMethodInterceptor(Provider<CacheResolver> cacheResolverProvider, Provider<CacheKeyGenerator> defaultCacheKeyGeneratorProvider)
focal_class.class_method_signature: CacheRemoveAllMethodInterceptor.invoke(MethodInvocation methodInvocation)
focal_class.full_signature: @Override public Object invoke(MethodInvocation methodInvocation)
focal_class.identifier: invoke
focal_class.modifiers: @Override public
focal_class.parameters: (MethodInvocation methodInvocation)
focal_class.return: Object
focal_class.signature: Object invoke(MethodInvocation methodInvocation)
focal_class.superclass: extends AbstractCacheMethodInterceptor
focal_method.body: @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
  
      final Method method = methodInvocation.getMethod();
      final CacheRemoveAll annotation = method.getAnnotation(CacheRemoveAll.class);
      checkNotNull(annotation);
      final CacheKeyInvocationContext<CacheRemoveAll> context = new GuiceCacheKeyInvocationContext<>(methodInvocation, annotation, annotation.cacheName());
  
      LOGGER.trace("Cache REMOVE_ALL {}", context.getMethod().getName());
  
      // get cache
      final Cache<GeneratedCacheKey, Optional<?>> cache = getCache(context, methodInvocation);
  
      if (!annotation.afterInvocation()) {
        cache.invalidateAll();
      }
  
      final Object result = methodInvocation.proceed();
  
      if (annotation.afterInvocation()) {
        cache.invalidateAll();
      }
  
      return result;
    }
focal_method.class_method_signature: CacheRemoveAllMethodInterceptor.invoke(MethodInvocation methodInvocation)
focal_method.full_signature: @Override public Object invoke(MethodInvocation methodInvocation)
focal_method.identifier: invoke
focal_method.invocations: getMethod getAnnotation checkNotNull cacheName trace getName getMethod getCache afterInvocation invalidateAll proceed afterInvocation invalidateAll
focal_method.modifiers: @Override public
focal_method.parameters: (MethodInvocation methodInvocation)
focal_method.return: Object
focal_method.signature: Object invoke(MethodInvocation methodInvocation)