October 2018
Intermediate to advanced
590 pages
15h 5m
English
First things first: Let's create the unit test class UserServiceImplTests. To test UserServiceImpl, we will need to mock its dependencies—RegistrationManagement, MailManager, and DomainEventPublisher. There will be at least the following test methods to cover the different scenarios:
The following is how the first test method looks:
...public class UserServiceImplTests { private RegistrationManagement registrationManagementMock; private DomainEventPublisher eventPublisherMock; private MailManager mailManagerMock; private UserServiceImpl instance; @Before public ...Read now
Unlock full access