August 2017
Beginner to intermediate
370 pages
8h 37m
English
In this section, you will learn about different mocking techniques which will be used for mocking the dependencies of a class. In the example given here, mocking techniques are described using the UserServiceTests class, which comprises of unit tests for the UserServiceImpl class. This class has a dependency, namely, UserDAO, which is a data access object used to interact with the underlying database, and, whose methods such as findByEmail is invoked to find whether a user exists in the database. The given the principles of unit tests, where we need to create test replacements or test doubles for the dependencies, we will create a test double for the dependency, UserDAO. There are three different techniques, ...
Read now
Unlock full access