Is there a way to check which interceptors are present for the current method?
An example: if I am debugging the following method (any line in the method)
@OpenSession
@Transactional
public void run() {
// do something ...
}
is it possible to check that the @OpenSession and @Transactional intercept开发者_StackOverflow社区ors are actually doing their work?
Sure: set a breakpoint in one of the Aspect classes.
You can debug Spring AOP with any IDE and real aspectj with Eclipse's AspectJ Developer Tools (which are included in the SpringSource ToolSuite.
You need to write a test (Test driven Design) that verify the side effect of the annotation you want to have.
The test should fail without annotation, and should pass if the annotation trigger the action you need.
精彩评论