use of org.apereo.cas.web.flow.login.TicketGrantingTicketCheckAction in project cas by apereo.
the class TicketGrantingTicketCheckActionTests method verifyValidTicket.
@Test
public void verifyValidTicket() throws Exception {
final MockRequestContext ctx = new MockRequestContext();
final AuthenticationResult ctxAuthN = CoreAuthenticationTestUtils.getAuthenticationResult(getAuthenticationSystemSupport());
final TicketGrantingTicket tgt = this.getCentralAuthenticationService().createTicketGrantingTicket(ctxAuthN);
WebUtils.putTicketGrantingTicketInScopes(ctx, tgt);
final TicketGrantingTicketCheckAction action = new TicketGrantingTicketCheckAction(this.getCentralAuthenticationService());
final Event event = action.doExecute(ctx);
assertEquals(TicketGrantingTicketCheckAction.VALID, event.getId());
}
use of org.apereo.cas.web.flow.login.TicketGrantingTicketCheckAction in project cas by apereo.
the class TicketGrantingTicketCheckActionTests method verifyNullTicket.
@Test
public void verifyNullTicket() throws Exception {
final MockRequestContext ctx = new MockRequestContext();
final TicketGrantingTicketCheckAction action = new TicketGrantingTicketCheckAction(this.getCentralAuthenticationService());
final Event event = action.doExecute(ctx);
assertEquals(TicketGrantingTicketCheckAction.NOT_EXISTS, event.getId());
}
use of org.apereo.cas.web.flow.login.TicketGrantingTicketCheckAction in project cas by apereo.
the class TicketGrantingTicketCheckActionTests method verifyInvalidTicket.
@Test
public void verifyInvalidTicket() throws Exception {
final MockRequestContext ctx = new MockRequestContext();
final MockTicketGrantingTicket tgt = new MockTicketGrantingTicket("user");
WebUtils.putTicketGrantingTicketInScopes(ctx, tgt);
final TicketGrantingTicketCheckAction action = new TicketGrantingTicketCheckAction(this.getCentralAuthenticationService());
final Event event = action.doExecute(ctx);
assertEquals(TicketGrantingTicketCheckAction.INVALID, event.getId());
}
Aggregations