I can unit test most of my Spring classes without needing to do Spring \"stuff\".
I can unit test @Before advice methods without using Spring too:
Example co
You can test a Spring Aspect by creating a proxy programatically:
MyInterface target = new MyClass();
AspectJProxyFactory factory = new AspectJProxyFactory(target);
MyAspect aspect = new MyAspect(arg);
factory.addAspect(aspect);
MyInterface proxy = factory.getProxy();
... then you can call methods on proxy
, and make assertions about aspect
, proxy
and target
.