I have started to study JMock. My goal is to write JUnit tests for Spring application, a.k.a controllers and domain classes. In controllers data from database and other services is put to models. I need to make sure that the data is persistent for testing, so basically i need to put the test data to database before test, and erase it after. I guess this could be done with mock objects, not autowiring the real beans.
I have googled. Some pages say only interfaces can be mocked. Some say all objects can be mocked. Some say even that DAO's should not be mocked. I'm confused.
Can anyone tell me, is JMock essential in Spring application testing and where to get started?