My method interceptor isn't called in test context. the test context is configured for my test class: with @ContextConfiguration(locations = {"classpath:testContext.xml"}) and I have a method interceptor:
public class MyMethodInterceptor implements MethodInterceptor {
@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
System.out.println("invocation >>>> " + invocation);
}
and it's configured in my context.xml file like this:
<bean id="myMethodInterceptor" class="path.to.interceptor.MyMethodInterceptor"/>
<aop:config>
<aop:advisor pointcut="@within(path.to.annotation.MyAnnotation)"
advice-ref="myMethodInterceptor" order="10"/>
</aop:config>
my expectation is in my test when I call a method with MyAnnotation the interceptor is being called, but it will not. I'm using JUnit 4.12