Question: Write a happy-path test for the class presented below. Verify that the user gets his new password, and that the updateUser() method of userDAO is

Write a happy-path test for the class presented below. Verify that the user gets his new password, and that the updateUser() method of userDAO is called.

Listing 5.43. The UserServiceImpl class public class UserServiceImpl {

private UserDAO userDAO; private SecurityService securityService; public void assignPassword(User user) throws Exception { String passwordMd5 = securityService.md5(user.getPassword()); user.setPassword(passwordMd5); userDAO.updateUser(user); } public UserServiceImpl(UserDAO dao, SecurityService security) { this.userDAO = dao; this.securityService = security; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!