I have an object with no interface (I can't change this), I was able to mock it using
Mock mockedClass = mock(ObjectExample.class, "returnObject",
new Class[ ]{java.lang.Integer, java.lang.Integer},
new Object[ ]{1,9001});
This object is successfully mocked, and on debugging I can see the parameters are being successfully set, my question is how can I then use this mocked object; for example how would I return the object returnOnject
to use later on in the code, and to mock out calls to this object?
Edit: I am using JMock with CGLIB