EasyMock 3.0 documentation (http://www.easymock.org/EasyMock3_0_Documentation.html) claims that it is, but doesn’t explain why (emphasis mine):
Sometimes you may need to mock only some methods of a class and keep
the normal behavior of others. This usually happens when you want to
test a method that calls some others in the same class. So you want to
keep the normal behavior of the tested method and mock the others.In this case, the first thing to do is to consider a refactoring since
most of the time this problem caused by a bad design.
So, is this correct? And why?
The problem is not calling own methods, but rather the necessity to mock those calls is indicative of another problem. Otherwise you can just test the public methods and verify their behavior. You shouldn’t need to care about what other methods that one calls, but only about the observable behavior.