I like to know what mock objects are in Java. Why do we create them and what are their uses?
Quote from here: http://easymock.org/
Unit testing is the testing of software units in isolation. However, most units do not work alone, but they collaborate with other units. To test a unit in isolation, we have to simulate the collaborators in the test. A Mock Object is a test-oriented replacement for a collaborator. It is configured to simulate the object that it replaces in a simple way.
for example, if you are wanting to test http calls you will need to create real-life request objects,complete with all their dependencies. This can often require a lot of effort, hence the use of mocked objects which provide a quicker path to creating an accurate rendition of the object you need, without the long chain of dependencies.