Mocking an Aspect class invoked after an exception is thrown in Junit
问题 I have an aspect class as below - public class TestAspect { @AfterThrowing(pointcut = "execution(* *(..)) ", throwing = "testException") public void afterThrowAdvice(TestException testException) throws Exception { } } Now anytime any class throws TestException, TestAspect's afterThrowAdvice method is getting called. From Unit tests as well without using any spring configuration xmls, running as a plain junit test. How do I mock to not do anything when that method is called? I tried in my unit