I'm trying to implement a simple Spring AOP (v4) example using @Before
advice with an in-place pointcut expression, but the aspect method is not invoked. I have all the required dependencies(spring-aop, aopalliance, aspectweaver). What am I doing wrong?
package com.xyz;
public class TestClass {
@PostConstruct
public void init() {
test();
}
public void test() {
...
}
}
The aspect:
@Aspect
@Component
public class MyAspect{
@Before("execution(* com.xyz.TestClass.test())")
public void beforeTest() {
...
}
}