@Test void testExecuteAnnotatedClass() throws Throwable { doReturn(0L, 100L).when(clock).monotonicTime(); when(proceedingJoinPoint.getSignature()).thenReturn(signature); when(signature.getMethod()).thenReturn(AnnotatedClass.class.getMethod("annotatedMethod")); when(proceedingJoinPoint.getStaticPart()).thenReturn(staticPart); when(staticPart.getSignature()).thenReturn(signature); when(proceedingJoinPoint.getSignature()).thenReturn(signature); when(signature.getDeclaringTypeName()).thenReturn("AnnotatedMethod"); when(signature.getName()).thenReturn("annotatedMethod"); when(proceedingJoinPoint.proceed()).thenReturn(42); assertEquals(42, timedAspect.timedClassMethod(proceedingJoinPoint)); verify(proceedingJoinPoint, times(1)).proceed(); Timer timer = meterRegistry.get("test.class").timer(); assertEquals(1, timer.count()); assertEquals(100.0, timer.max(NANOSECONDS)); }
@Around("execution(* (@io.micrometer.core.annotation.Timed *).*(..))") public Object timedClassMethod(ProceedingJoinPoint pjp) throws Throwable { Method method = ((MethodSignature) pjp.getSignature()).getMethod(); return timedProceed(pjp, method.getDeclaringClass().getAnnotation(Timed.class)); }
MolgenisTimedAspect { @Around("execution(* (@io.micrometer.core.annotation.Timed *).*(..))") public Object timedClassMethod(ProceedingJoinPoint pjp) throws Throwable { Method method = ((MethodSignature) pjp.getSignature()).getMethod(); return timedProceed(pjp, method.getDeclaringClass().getAnnotation(Timed.class)); } }
MolgenisTimedAspect { @Around("execution(* (@io.micrometer.core.annotation.Timed *).*(..))") public Object timedClassMethod(ProceedingJoinPoint pjp) throws Throwable { Method method = ((MethodSignature) pjp.getSignature()).getMethod(); return timedProceed(pjp, method.getDeclaringClass().getAnnotation(Timed.class)); } MolgenisTimedAspect(MeterRegistry registry);   MolgenisTimedAspect(
      MeterRegistry registry, Function<ProceedingJoinPoint, Iterable<Tag>> tagsBasedOnJoinpoint); }
MolgenisTimedAspect { @Around("execution(* (@io.micrometer.core.annotation.Timed *).*(..))") public Object timedClassMethod(ProceedingJoinPoint pjp) throws Throwable { Method method = ((MethodSignature) pjp.getSignature()).getMethod(); return timedProceed(pjp, method.getDeclaringClass().getAnnotation(Timed.class)); } MolgenisTimedAspect(MeterRegistry registry);   MolgenisTimedAspect(
      MeterRegistry registry, Function<ProceedingJoinPoint, Iterable<Tag>> tagsBasedOnJoinpoint); @Around("execution(* (@io.micrometer.core.annotation.Timed *).*(..))") Object timedClassMethod(ProceedingJoinPoint pjp); @Around("execution (@io.micrometer.core.annotation.Timed * *.*(..))") Object timedMethod(ProceedingJoinPoint pjp); }
MolgenisTimedAspect { @Around("execution(* (@io.micrometer.core.annotation.Timed *).*(..))") public Object timedClassMethod(ProceedingJoinPoint pjp) throws Throwable { Method method = ((MethodSignature) pjp.getSignature()).getMethod(); return timedProceed(pjp, method.getDeclaringClass().getAnnotation(Timed.class)); } MolgenisTimedAspect(MeterRegistry registry);   MolgenisTimedAspect(
      MeterRegistry registry, Function<ProceedingJoinPoint, Iterable<Tag>> tagsBasedOnJoinpoint); @Around("execution(* (@io.micrometer.core.annotation.Timed *).*(..))") Object timedClassMethod(ProceedingJoinPoint pjp); @Around("execution (@io.micrometer.core.annotation.Timed * *.*(..))") Object timedMethod(ProceedingJoinPoint pjp);  }