use of io.vertigo.account.impl.authentication.UsernamePasswordAuthenticationToken in project vertigo by KleeGroup.
the class AuthenticationManagerTest method loginSuccess.
private Optional<Account> loginSuccess() {
final AuthenticationToken token = new UsernamePasswordAuthenticationToken("admin", "v3rt1g0");
final Optional<Account> account = authenticationManager.login(token);
Assert.assertTrue("Authent fail", account.isPresent());
final Optional<UserSession> userSession = securityManager.getCurrentUserSession();
Assert.assertTrue("No UserSession", userSession.isPresent());
Assert.assertTrue("Not authenticated", userSession.get().isAuthenticated());
return account;
}
Aggregations