MethodLoggingAdvice { @Around("operationsMethods()") public Object logMethodBeingInvoked(ProceedingJoinPoint pjp) throws Throwable { Class<?> targetClass = pjp.getTarget().getClass(); MethodSignature targetMethodSignature = (MethodSignature) pjp.getSignature(); Method targetMethod = targetMethodSignature.getMethod(); if (targetMethod.getDeclaringClass().isInterface()) { targetMethod = pjp.getTarget().getClass().getMethod(pjp.getSignature().getName(), targetMethod.getParameterTypes()); } if ((AnnotationUtils.findAnnotation(targetClass, SuppressLogging.class) == null) && (AnnotationUtils.findAnnotation(targetMethod, SuppressLogging.class) == null) && (LOGGER.isDebugEnabled())) { LOGGER.debug("javaMethod=\"{}.{}\"", targetClass.getName(), targetMethodSignature.getName()); } return pjp.proceed(); }  @Around("operationsMethods()") Object logMethodBeingInvoked(ProceedingJoinPoint pjp);  }
@Test public void testLogMethodTime() throws Throwable { methodLoggingAdvice.logMethodBeingInvoked(new MockProceedingJoinPoint()); }
@Test public void testLogMethodTimeClassSuppressLogging() throws Throwable { methodLoggingAdvice.logMethodBeingInvoked(new MockProceedingJoinPointClassSuppressLogging()); }
@Test public void testLogMethodTimeMethodSuppressLogging() throws Throwable { methodLoggingAdvice.logMethodBeingInvoked(new MockProceedingJoinPointMethodSuppressLogging()); }