use of org.apereo.cas.authentication.DefaultMultifactorAuthenticationContextValidator in project cas by apereo.
the class DefaultMultifactorAuthenticationContextValidatorTests method verifyContextFailsValidationWithNoProviders.
@Test
public void verifyContextFailsValidationWithNoProviders() {
val applicationContext = new StaticApplicationContext();
applicationContext.refresh();
val v = new DefaultMultifactorAuthenticationContextValidator("authn_method", "trusted_authn", applicationContext);
val result = v.validate(MultifactorAuthenticationTestUtils.getAuthentication("casuser"), "invalid-context", Optional.of(MultifactorAuthenticationTestUtils.getRegisteredService()));
assertFalse(result.isSuccess());
}
use of org.apereo.cas.authentication.DefaultMultifactorAuthenticationContextValidator in project cas by apereo.
the class DefaultMultifactorAuthenticationContextValidatorTests method verifyContextFailsValidationWithMissingProvider.
@Test
public void verifyContextFailsValidationWithMissingProvider() {
val applicationContext = getStaticApplicationContext();
val v = new DefaultMultifactorAuthenticationContextValidator("authn_method", "trusted_authn", applicationContext);
val result = v.validate(MultifactorAuthenticationTestUtils.getAuthentication("casuser"), "invalid-context", Optional.of(MultifactorAuthenticationTestUtils.getRegisteredService()));
assertFalse(result.isSuccess());
}
Aggregations