use of org.apache.shiro.authc.IncorrectCredentialsException in project shiro by apache.
the class JDBCRealmTest method testSaltColumnWrongPassword.
@Test
public void testSaltColumnWrongPassword() throws Exception {
String testMethodName = name.getMethodName();
JdbcRealm realm = realmMap.get(testMethodName);
createSaltColumnSchema(testMethodName);
realm.setSaltStyle(JdbcRealm.SaltStyle.COLUMN);
Subject.Builder builder = new Subject.Builder(securityManager);
Subject currentUser = builder.buildSubject();
UsernamePasswordToken token = new UsernamePasswordToken(username, "passwrd");
try {
currentUser.login(token);
} catch (IncorrectCredentialsException ex) {
// Expected
}
}
Aggregations