Make AspectJ pointcut in test more robust
The previous pointcut attempted to match against a local lambda type; however, that pointcut was unreliable and failed sporadically. This commit therefore changes the pointcut so that it specifically targets the get() method of a subtype of Supplier, which seems to result in reliable pointcut matching.
This commit is contained in:
@@ -609,7 +609,7 @@ abstract class AbstractProxyTargetClassConfig {
|
||||
@Aspect
|
||||
static class SupplierAdvice {
|
||||
|
||||
@Around("execution(public * org.springframework.aop.aspectj.autoproxy..*.*(..))")
|
||||
@Around("execution(* java.util.function.Supplier+.get())")
|
||||
Object aroundSupplier(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
return "advised: " + joinPoint.proceed();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user