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:
Sam Brannen
2024-09-04 17:30:16 +02:00
parent 46655f367e
commit caaa86d6cf

View File

@@ -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();
}