Improve test coverage for AbstractMethodMockingControl
This commit improves the test coverage for AbstractMethodMockingControl by introducing tests that verify expected behavior for: - reentrant method invocations via public methods - reentrant method invocations via private methods - test methods that do not set expectations or invoke playback() - test methods that throw exceptions For a more complete discussion of "after" vs. "after returning" advice within AbstractMethodMockingControl, see the Javadoc in the tests.
This commit is contained in:
@@ -190,8 +190,8 @@ public abstract aspect AbstractMethodMockingControl percflow(mockStaticsTestMeth
|
||||
after() returning : mockStaticsTestMethod() {
|
||||
if (recording && (expectations.hasCalls())) {
|
||||
throw new IllegalStateException(
|
||||
"Calls recorded, yet playback state never reached: Create expectations then call "
|
||||
+ this.getClass().getSimpleName() + ".playback()");
|
||||
"Calls have been recorded, but playback state was never reached. Set expectations and then call "
|
||||
+ this.getClass().getSimpleName() + ".playback();");
|
||||
}
|
||||
expectations.verify();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user