Skip to content

Commit caaa86d

Browse files
committed
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.
1 parent 46655f3 commit caaa86d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ SupplierAdvice supplierAdvice() {
609609
@Aspect
610610
static class SupplierAdvice {
611611

612-
@Around("execution(public * org.springframework.aop.aspectj.autoproxy..*.*(..))")
612+
@Around("execution(* java.util.function.Supplier+.get())")
613613
Object aroundSupplier(ProceedingJoinPoint joinPoint) throws Throwable {
614614
return "advised: " + joinPoint.proceed();
615615
}

0 commit comments

Comments
 (0)