The MongoTemplate class has a nested class -QueryCursorPreparer. My task is to intercept the QueryCursorPreparer.getReadPreference () method. How could I do this? When trying to do this:
@Aspect
@Component
public class MongoInterceptor {
@Around("execution(* org.springframework.data.mongodb.core.MongoTemplate.*(..))")
public Object intercept(ProceedingJoinPoint joinPoint) throws Throwable {
System.out.println("TEST");
return joinPoint.proceed();
}
}
Nothing is intercepted