To test the DB, we need create the test on JUnit:
- On the @Before we need:
- Load the Script of SQL (To run in any machine, and helpus to any change on the database)
- Load the database information into a .XML (DBUnit)
- To do this, we need configurate the DBunit to use a large dataset and we get the information on the XML.
- On the @Test, we can do the test normaly
References:
Stackoverflow:
- http://stackoverflow.com/questions/24491397/db-unit-testing-insert-and-update-operations
- http://stackoverflow.com/questions/14355969/import-export-xml-for-dbunit