How do you think mocks are going to help you?
Mock objects are used as "stand-ins" for the real things so that you can test something that interacts with them. The mocks are merely there to simulate the behavior of the more unwieldy things they stand in for. In the case of DAOs, the thing you are testing is usually the class that uses the DAO. A DAO is normally an interface, which makes it easier to mock out.
Those are just examples of how you might define classes based on a DAO interface.
This is an example of how you might unit test a class that uses TwitterFeedDao:
If you are going to
unit test a MongoDBDao, then you'd have to mock out the connection and anything else that represents MongoDB functionality. I wouldn't bother with that though. My approach with DAOs is to use
integration tests with them. Spring has many wonderful features to help write integration tests. Google for "
integration testing with Spring and MongoDB".
See also:
http://docs.mockito.googlecode.com/hg/1.9.5/org/mockito/InjectMocks.html