I'm writing the canonical execution time logging aspect, and I would like to test my pointcut expression.
More clearly, suppose I have the following pointcut expression in an aspect
@Around("within(@org.springframework.stereotype.Service *)") public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable { // ... } How can I make sure that my aspect will correctly be triggered in a test without writing an additionnal "test aspect"?
To say it otherwise, given this service class
@Service public class VisitService { VisitRepository repository; public VisitService(VisitRepository repository) { super(); this.repository = repository; } public Visit findByReferenceNumber() { return repository.findByReferenceNumber(); } } Is there some "Spring code" able to tell me which methods will be decorated with the logAround(...) method?