I work with existing test cases that are used EasyMockto mock a class. I overloaded the method with no parameters, so now there is a method to take a string. For instance:
public class HelloClass {
public String methodHello() {
...
}
public String methodHello(String msg) {
...
}
}
In the test class, HelloClass is ridiculed. As a result, I added an overloaded method so that we had an declaration:
public static HelloClass mockHelloClass = createMockBuilder(HelloClass.class)
.addMockedMethod("methodHello")
.addMockedMethod("methodHello", String.class)
.createMock();
However, when I run them, test cases fail. When I make the method methodHello(String)private, then the test cases pass again.
Is it EasyMockcapable of handling multiple overloaded methods added to createMockBuilder?