My unit test framework replaces business service components with Mock objects using EasyMock.createMock(Interace).
These components are accessed several layers down in the class under test so I don't wish to modify either the interface definition nor the class undertest.
I then use EasyMock.expect(...) to drive the behavoir of the collaborating objects. This works great as long as the methods don't return void.
How can I drive the behavior when there are void results. Ie.
EasyMock.expect(object.Method( EasyMock.isA(arg1) ).andAnswer( new IAnswer()){
public void anser(){
... do seomething meaningful with arg1...
}).anyTimes();