Stubbing and Mocking with Mockito and JUnit

Mocking and stubbing are the cornerstones of having quick and simple unit tests. Mocks are useful if you have a dependency on an external system, file reading takes too long, the database connection is unreliable, or if you don’t want to send an email after every test. Unlike with integration or functional tests, where the … Continue reading Stubbing and Mocking with Mockito and JUnit