title: How to record and reuse database results for JUnit tests
body: <p>I would like to leverage the existing database as a source for JUnit test data. Some scenarios are quite complex and it is a hassle to set up all the objects manually.</p>
  
  <p>I am thinking in terms of a decorator for my existing DAO that will serialize the objects my real SQL connected DAO is returning from the database and record them to files.</p>
  
  <p>Something along the lines of running the JUnit testcase in record once mode and afterwards always replaying the recorded data and not going to the database.</p>
  
  <p>Are there frameworks for Java to ease this process or do I have to implement it myself?</p>