Added test to make sure password is verified with totp login

This commit is contained in:
Stian Thorgersen 2014-07-24 14:15:02 +01:00
parent 511cc483cb
commit b5835fc232

View file

@ -128,4 +128,19 @@ public class LoginTotpTest {
events.expectLogin().assertEvent();
}
@Test
public void loginWithTotpInvalidPassword() throws Exception {
loginPage.open();
loginPage.login("test-user@localhost", "invalid");
loginTotpPage.assertCurrent();
loginTotpPage.login(totp.generate("totpSecret"));
loginPage.assertCurrent();
Assert.assertEquals("Invalid username or password.", loginPage.getError());
events.expectLogin().error("invalid_user_credentials").removeDetail(Details.CODE_ID).session((String) null).assertEvent();
}
}