

This is where mocking frameworks comes in to play.

We don’t want the unit test of the addCustomer() fail if there is a defect in save() method in the CustomerDao.We only want to test the logic inside the addCustomer() in isolation.We don’t want to call the real implementation of the CustomerDao save() method for a few reasons:

