throws Exception
{
KenaiRealm kenaiRealm = this.getRealm();
try {
Assert.assertNotNull(kenaiRealm.getAuthenticationInfo(new UsernamePasswordToken("unknown-user-foo-bar",
"invalid")));
Assert.fail("Expected: AccountException to be thrown");
}
catch (AccountException e) {
// expected
}
try {
kenaiRealm.getAuthenticationInfo(new UsernamePasswordToken("random", "JUNK-PASS"));
Assert.fail("Expected: AccountException to be thrown");
}
catch (AccountException e) {
// expected
}
Assert.assertNotNull(kenaiRealm.getAuthenticationInfo(new UsernamePasswordToken(username, password)));
try {
kenaiRealm.getAuthenticationInfo(new UsernamePasswordToken("random", "JUNK-PASS"));
Assert.fail("Expected: AccountException to be thrown");
}
catch (AccountException e) {
// expected
}