I am referring to this simple example on how to create a DB Unit Test for an "Insert" DB operation in a Spring application:
Junit test case for database insert method with DAO and web service
I have a similar add() method that I want to unit-test. But in that example, the solution is to do a findById(..) fetch afterwards to verify the insertion.
My question is, my application has no need for this findById operation, so do I need to still add it to my DAO object just for the purpose of unit testing? I would prefer to keep my DAO geared toward the specific actions required by the app only. Also, if I add this findById(..), this new operation itself will require a unit test?
What are the standard solutions to this problem? Do unit tests require their own DAO architecture?