use of org.apereo.cas.web.flow.login.SessionStoreTicketGrantingTicketAction in project cas by apereo.
the class SessionStoreTicketGrantingTicketActionTests method verifyOperation.
@Test
public void verifyOperation() throws Exception {
val context = new MockRequestContext();
val request = new MockHttpServletRequest();
val response = new MockHttpServletResponse();
context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, response));
RequestContextHolder.setRequestContext(context);
ExternalContextHolder.setExternalContext(context.getExternalContext());
WebUtils.putTicketGrantingTicketInScopes(context, new MockTicketGrantingTicket("casuser"));
val action = new SessionStoreTicketGrantingTicketAction(JEESessionStore.INSTANCE);
val result = action.execute(context);
assertNull(result);
val webContext = new JEEContext(request, response);
assertTrue(JEESessionStore.INSTANCE.get(webContext, WebUtils.PARAMETER_TICKET_GRANTING_TICKET_ID).isPresent());
}
Aggregations