private AccountService accountService;
@Test
public void testAuthenticateEmailAccount()
{
Account account = new Account();
account.setLoginType( LoginType.OPEN_ID );
account.setEmail( "pohorelecjozef@gmail.com" );
accountService.saveAccount( account );
SessionUser sessionUser = new SessionUser();
sessionUser.setEmail( account.getEmail() );
sessionUser.setLoginType( LoginType.OPEN_ID );
try
{
Account authorizedAccount = ( Account ) authService.authenticate( sessionUser );
Assert.assertEquals( "pohorelecjozef@gmail.com", authorizedAccount.getEmail() );
}
catch ( AuthenticatedException e )
{
Assert.fail( "This exception should not be thrown: " + e );
}