Last active
January 11, 2018 04:54
-
-
Save Adrianvdh/aac93ea148d7e1fbc9eaae26ba6d6543 to your computer and use it in GitHub Desktop.
Tdd examples from http://scholarcoder.com/1392/ttd-intro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void userLoginWithCorrectCredentials() throws Exception { | |
// Given that this user exists | |
String username = "adrianvdh"; | |
String password = "hello123"; | |
AuthorisationContext authorisationContext = new AuthorisationContext(); | |
// When authenticating | |
authorisationContext.authenticate(username, password); | |
// Then the session must be valid | |
Session userSession = Session.getCurrentSession(); | |
Assert.assertEquals("adrianvdh", userSession.getAuthenticatedUser().username); | |
Assert.assertEquals("hello123", userSession.getAuthenticatedUser().password); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment