...
Our unit test would use a mock version of advisorDao, and we would tell the mock framework to expect a call to getAdvisees() and for this method call to return a list of Student objects, like so:
Code Block |
---|
expect(advisorDao.getAdvisees()).andReturn(studentList); |
We would need to manually create the studentList list, instantiate a number of Student objects, and add them all to a Listthe list. Perhaps our test also requires us to peek inside the Student objects and examine the enrollment profile or other embedded objects. We would be required to instantiate all of these objects and set them inside our Student objects. This takes a lot of time and is very tedious.
...