Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@aritraroy
Last active April 8, 2018 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aritraroy/c7c099eaaae95e2a4316120c8f460fe2 to your computer and use it in GitHub Desktop.
Save aritraroy/c7c099eaaae95e2a4316120c8f460fe2 to your computer and use it in GitHub Desktop.
@Test
public void login_successIfUserNameAndPasswordIsValid() {
// Arrange
String username = "username";
String password = "password";
when(userRepository.isUsernameValid(username)).thenReturn(true);
when(userRepository.isPasswordValid(password)).thenReturn(true);
// Act
boolean result = authenticator.login(username, password);
// Assert
assertTrue(result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment