I am currently using EasyMock and creating mock objects like this
mockedObject = createMock(myInterface.class);
Easy mock is an unnecessary overhead(because the method that i mock is really simple) and i would like to create a mock without it.
But the problem is myInterface is an interface so how do i instantiate it.Please suggest.
Thanks,
Sriram
The easiest way would be to create an inner class that implements the interface, implement the methods to return the data that you want, then use it in the test case.
For example: