55. User logging in test (#5)

This commit is contained in:
Art
2021-09-07 21:56:18 +03:00
parent cebe382dbd
commit ad785f05b1
3 changed files with 110 additions and 3 deletions

View File

@ -42,7 +42,7 @@ public class UserServiceImpl implements UserService {
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
User user = userRepository
.findByUsername(username)
.orElseThrow(() -> new UserNotFoundException(String.format(USERNAME_NOT_FOUND_MSG, username)));
.orElseThrow(() -> new UsernameNotFoundException(String.format(USERNAME_NOT_FOUND_MSG, username)));
user.setLastLoginDateDisplay(user.getLastLoginDate());
user.setLastLoginDate(LocalDateTime.now());
return new UserPrincipal(user);