I have a method like this:
public void MyMethod(int p1, int p2) {
//some logic here
MyObject mo = new MyObject(var1,var2);
int returnedId = mo.doOperation(something);
//Do something with the returnedId;
}
I want to test this method but I can't mock the constructor call, so a test around this would break modularity. I could do it with a factory method or something but since I only have one constructor there is no point.
How is this generally done using EasyMock?