test_class.declarator: stopWatchAdvice
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private StopWatchAdvice stopWatchAdvice;
test_class.type: StopWatchAdvice
test_class.var_name: stopWatchAdvice
test_class.file: herd-code/herd-service/src/test/java/org/finra/herd/service/advice/StopWatchAdviceTest.java
test_class.identifier: StopWatchAdviceTest
test_class.superclass: extends AbstractServiceTest
test_case.body: @Test
      public void testLogMethodTimeTargetMethodIsInterface() throws Throwable
      {
          // Mock a join point of the method call.
          ProceedingJoinPoint joinPoint = getMockedProceedingJoinPoint(new Command()
          {
              @Override
              public void execute() throws Exception
              {
                  return;
              }
          }, Command.class.getDeclaredMethod("execute"));
  
          // Call the method under test.
          stopWatchAdvice.logMethodTime(joinPoint);
      }
test_case.class_method_signature: StopWatchAdviceTest.testLogMethodTimeTargetMethodIsInterface()
test_case.full_signature: @Test public void testLogMethodTimeTargetMethodIsInterface()
test_case.identifier: testLogMethodTimeTargetMethodIsInterface
test_case.invocations: getMockedProceedingJoinPoint getDeclaredMethod logMethodTime
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testLogMethodTimeTargetMethodIsInterface()
focal_class.declarator: LOGGER = LoggerFactory.getLogger("org.finra.herd.core.StopWatchAdvice")
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger("org.finra.herd.core.StopWatchAdvice");
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.file: herd-code/herd-service/src/main/java/org/finra/herd/service/advice/StopWatchAdvice.java
focal_class.identifier: StopWatchAdvice
focal_class.class_method_signature: StopWatchAdvice.logMethodTime(ProceedingJoinPoint pjp)
focal_class.full_signature: @Around("serviceMethods()") public Object logMethodTime(ProceedingJoinPoint pjp)
focal_class.identifier: logMethodTime
focal_class.modifiers: @Around("serviceMethods()") public
focal_class.parameters: (ProceedingJoinPoint pjp)
focal_class.return: Object
focal_class.signature: Object logMethodTime(ProceedingJoinPoint pjp)
focal_class.superclass: extends AbstractServiceAdvice
focal_method.body: @Around("serviceMethods()")
      public Object logMethodTime(ProceedingJoinPoint pjp) throws Throwable
      {
          // Get the target class being called.
          Class<?> targetClass = pjp.getTarget().getClass();
  
          // Get the target method being called.
          MethodSignature targetMethodSignature = (MethodSignature) pjp.getSignature();
          Method targetMethod = targetMethodSignature.getMethod();
          if (targetMethod.getDeclaringClass().isInterface())
          {
              // Get the underlying implementation if we are given an interface.
              targetMethod = pjp.getTarget().getClass().getMethod(pjp.getSignature().getName(), targetMethod.getParameterTypes());
          }
  
          // Only keep a stop watch if the class and method aren't suppressing logging and the log level is info.
          if ((AnnotationUtils.findAnnotation(targetClass, SuppressLogging.class) == null) &&
              (AnnotationUtils.findAnnotation(targetMethod, SuppressLogging.class) == null) && (LOGGER.isInfoEnabled()))
          {
              // Start the stop watch.
              StopWatch stopWatch = new StopWatch();
              stopWatch.start();
  
              // Proceed to the join point (i.e. call the method and let it return).
              Object returnValue = pjp.proceed();
  
              // Log the duration.
              long durationMilliseconds = stopWatch.getTime();
              LOGGER.info("javaMethod=\"{}.{}\" javaMethodDurationTimeInMilliseconds={} javaMethodDurationTimeFormatted=\"{}\"", targetClass.getName(),
                  targetMethodSignature.getName(), durationMilliseconds, HerdDateUtils.formatDuration(durationMilliseconds));
  
              // Return the method return value.
              return returnValue;
          }
          else
          {
              // Invoke the method normally.
              return pjp.proceed();
          }
      }
focal_method.class_method_signature: StopWatchAdvice.logMethodTime(ProceedingJoinPoint pjp)
focal_method.full_signature: @Around("serviceMethods()") public Object logMethodTime(ProceedingJoinPoint pjp)
focal_method.identifier: logMethodTime
focal_method.invocations: getClass getTarget getSignature getMethod isInterface getDeclaringClass getMethod getClass getTarget getName getSignature getParameterTypes findAnnotation findAnnotation isInfoEnabled start proceed getTime info getName getName formatDuration proceed
focal_method.modifiers: @Around("serviceMethods()") public
focal_method.parameters: (ProceedingJoinPoint pjp)
focal_method.return: Object
focal_method.signature: Object logMethodTime(ProceedingJoinPoint pjp)