use of org.apereo.cas.authentication.policy.AnyAuthenticationPolicy in project cas by apereo.
the class PolicyBasedAuthenticationManagerTests method verifyAuthenticateAnyButTryAllSuccess.
@Test
public void verifyAuthenticateAnyButTryAllSuccess() throws Exception {
final Map<AuthenticationHandler, PrincipalResolver> map = new HashMap<>();
map.put(newMockHandler(true), null);
map.put(newMockHandler(false), null);
final PolicyBasedAuthenticationManager manager = new PolicyBasedAuthenticationManager(getAuthenticationExecutionPlan(map), mockServicesManager(), new AnyAuthenticationPolicy(true));
final Authentication auth = manager.authenticate(transaction);
assertEquals(1, auth.getSuccesses().size());
assertEquals(1, auth.getFailures().size());
assertEquals(2, auth.getCredentials().size());
}
Aggregations