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.
@ -90,8 +88,8 @@ public class AnnotationDrivenStaticEntityMockingControlTests {
@@ -90,8 +88,8 @@ public class AnnotationDrivenStaticEntityMockingControlTests {
@ -100,28 +98,56 @@ public class AnnotationDrivenStaticEntityMockingControlTests {
@@ -100,28 +98,56 @@ public class AnnotationDrivenStaticEntityMockingControlTests {
@ -130,16 +156,24 @@ public class AnnotationDrivenStaticEntityMockingControlTests {
@@ -130,16 +156,24 @@ public class AnnotationDrivenStaticEntityMockingControlTests {
// Test that verification check doesn't blow up if no replay() call happened.
publicvoidnoExpectationsAndNoPlayback(){
// Ensure that mock verification doesn't blow up if playback() was not invoked and
// no expectations were set.
}
@Test
publicvoidnoExpectationsButWithPlayback(){
// Ensure that mock verification doesn't blow up if playback() was invoked but no
// expectations were set.
playback();
}
@Test(expected=IllegalStateException.class)
@ -150,21 +184,30 @@ public class AnnotationDrivenStaticEntityMockingControlTests {
@@ -150,21 +184,30 @@ public class AnnotationDrivenStaticEntityMockingControlTests {