Is there any way in JMock2 to let a test pass when reaching the execution of a given mock's method call? In other words, I would like to write some test code like:
assertTrue(when(aRequestMock).methodCall());
To test production code like:
public void methodUnderTest(){
// Some initialization code and members call
request.foo();
String a = anotherInstance.bar();
// many more calls to follow
}
...so I would not need to mock 'anotherInstance.bar()'
return value as well as any other mock call to follow?
I know that it would not represent any strict check and it cannot be considered a best practice, yet it would come handy when testing methods with a long list of members' methods.