Skip to content

Commit

Permalink
Rename login() to login_withInitialData_success() and other variable …
Browse files Browse the repository at this point in the history
…in UserServiceTest #9
  • Loading branch information
FaisolChehumar committed Feb 24, 2022
1 parent e434ba4 commit b1736ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public void setUserRepository(UserRepository userRepository) {
}

public String login(String username, String password) throws AuthenticationFailException {
Optional<UserModel> result = userRepository.findByUsernameAndPassword(username, password);
if(result.isPresent()) {
Optional<UserModel> matchedUser = userRepository.findByUsernameAndPassword(username, password);
if(matchedUser.isPresent()) {
return "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlVzZXIwMSJ9.saNh8MedJAAeSWE06XH5M-2EcWny0ZFfvIS-qJjFfWk";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ void findByUsernameAndPassword_WithInitialUser_success() {
userRepository.save(user);

// Act
Optional<UserModel> result = userRepository.findByUsernameAndPassword(username, password);
Optional<UserModel> matchedUser = userRepository.findByUsernameAndPassword(username, password);

// Assert
assertThat(result).isNotEmpty();
assertThat(matchedUser).isNotEmpty();
}
}

0 comments on commit b1736ac

Please sign in to comment.