Guest User

Untitled

a guest
Apr 15th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. @Test
  2. public void login_successIfUserNameAndPasswordIsValid() {
  3. // Arrange
  4. String username = "username";
  5. String password = "password";
  6.  
  7. when(userRepository.isUsernameValid(username)).thenReturn(true);
  8. when(userRepository.isPasswordValid(password)).thenReturn(true);
  9.  
  10. // Act
  11. boolean result = authenticator.login(username, password);
  12.  
  13. // Assert
  14. assertTrue(result);
  15. }
Add Comment
Please, Sign In to add comment