use of org.apereo.cas.adaptors.authy.AuthyTokenCredential in project cas by apereo.
the class AuthyAuthenticationWebflowEventResolverTests method beforeAll.
@BeforeEach
public void beforeAll() {
val request = new MockHttpServletRequest();
val response = new MockHttpServletResponse();
when(context.getMessageContext()).thenReturn(mock(MessageContext.class));
when(context.getConversationScope()).thenReturn(new LocalAttributeMap<>());
when(context.getFlowScope()).thenReturn(new LocalAttributeMap<>());
when(context.getRequestParameters()).thenReturn(new MockParameterMap());
when(context.getRequestScope()).thenReturn(new LocalAttributeMap<>());
when(context.getFlashScope()).thenReturn(new LocalAttributeMap<>());
when(context.getExternalContext()).thenReturn(new ServletExternalContext(new MockServletContext(), request, response));
RequestContextHolder.setRequestContext(context);
ExternalContextHolder.setExternalContext(context.getExternalContext());
WebUtils.putCredential(context, new AuthyTokenCredential("token"));
}
Aggregations