How to test an aspect with SpringBootTest?
问题 I created a simple aspect in Spring using Spring Boot 2.1.6.RELEASE. It basically logs the total time spent on a method. @Aspect @Component public class TimeLoggerAspect { private static final Logger log = LoggerFactory.getLogger(TimeLoggerAspect.class); @Around("@annotation(demo.TimeLogger)") public Object methodTimeLogger(ProceedingJoinPoint joinPoint) throws Throwable { long startTime = System.currentTimeMillis(); Object proceed = joinPoint.proceed(); long totalTime = System