use of org.apereo.cas.adaptors.yubikey.registry.ClosedYubiKeyAccountRegistry in project cas by apereo.
the class YubiKeyAccountCheckRegistrationActionTests method verifyActionRegister.
@Test
public void verifyActionRegister() throws Exception {
val context = new MockRequestContext();
val request = new MockHttpServletRequest();
context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, new MockHttpServletResponse()));
val authentication = CoreAuthenticationTestUtils.getAuthentication();
WebUtils.putAuthentication(authentication, context);
WebUtils.putMultifactorAuthenticationProviderIdIntoFlowScope(context, new YubiKeyMultifactorAuthenticationProvider());
val registry = new ClosedYubiKeyAccountRegistry(new DenyAllYubiKeyAccountValidator());
val action = new YubiKeyAccountCheckRegistrationAction(registry);
assertEquals(CasWebflowConstants.TRANSITION_ID_REGISTER, action.execute(context).getId());
}
Aggregations