Monday, February 25, 2008 05:54 PM
I am new to JUnit (and to java for that matter) and learning about Mock objects.
my question is on the reason as to why we use mocks, when there we can use a static instance of the object we need.
for example: INSTEAD OF DOING THIS--
List mockedList = mock(List.class);
why not use a static List instance in some class, like so
List statList = TestSetupClass.staticInstance; //a static List field