So I am using easymock to write unit test fpr a method inside my class. I have mocked an object inside this method and it works fine. The problem is inside this test method I have several calls to other methods inside the same class.
For example,
public class testClass {
public void testMethod() {
mockedObject.method(); --> I define a return type for this and it works fine.
this.otherMethod() {
--> Inside this method I have a call to the mocked object with different methods..
}
}
So my question is that, when the method calls another method by using this.otherMethod() should I define all the return values for the mockedObject calls inside otherMethod? Isn't there a way to specify a return value for otherMethod so that it won't even go inside the other method? Plz note that here this is not the mockedObject and that is why I cannot use eaymock return value for that. I was thinking maybe there might be a way around this.
Thanks.
Update: I found this for partial mocking of methods: http://www.easymock.org/EasyMock2_2_2_ClassExtension_Documentation.html Which helps to only mock specific methods. But when I try to use it, it crosses a line on createMock method.. Sth like wrong syntax!