I have a spring component with a method I need to check:
String methodA(String param) {
...//do something
}
Now I create an aspect to catch method execution:
@Aspect
@Component
@ConditionalOnProperty(name = "is.enabled", matchIfMissing = true)
public class LoggingAspect {
@AfterReturning(pointcut = "execution(* com.A.methodA(..))", returning = "result")
void logMethodA(String result) {
...//do something with result
}
In properties flag is set to true to trigger aspect
is.enabled=true
also tried execution(* com.A.methodA(String))
and no changes.
Copied methods from working aspects, they get triggered, can't find the clue.