Get Growing Object-Oriented Software Guided by Tests . It has some useful tips on how to check access to the database.
Personally, I usually break DAO tests in 2, a unit test with a database for testing DAO functionality and an integration test for checking database queries. If your DAO only has a database access code, you wonβt need a unit test.
, , , () . , , , insert. - ( FK), , .
, dbunit, , , , - , . , Test Data Builder .
dbmigrate, , .
, , / . "" , .