use of org.apereo.cas.authentication.AuthenticationResult in project cas by apereo.
the class AbstractServiceValidateControllerTests method verifyValidServiceTicket.
@Test
public void verifyValidServiceTicket() throws Exception {
final AuthenticationResult ctx = CoreAuthenticationTestUtils.getAuthenticationResult(getAuthenticationSystemSupport(), SERVICE);
final TicketGrantingTicket tId = getCentralAuthenticationService().createTicketGrantingTicket(ctx);
final ServiceTicket sId = getCentralAuthenticationService().grantServiceTicket(tId.getId(), SERVICE, ctx);
final MockHttpServletRequest request = new MockHttpServletRequest();
request.addParameter(SERVICE_PARAM, SERVICE.getId());
request.addParameter(TICKET_PARAM, sId.getId());
final ModelAndView mv = this.serviceValidateController.handleRequestInternal(request, new MockHttpServletResponse());
assertTrue(mv.getView().toString().contains(SUCCESS));
}
use of org.apereo.cas.authentication.AuthenticationResult in project cas by apereo.
the class AbstractServiceValidateControllerTests method getHttpServletRequest.
private HttpServletRequest getHttpServletRequest() throws Exception {
final AuthenticationResult ctx = CoreAuthenticationTestUtils.getAuthenticationResult(getAuthenticationSystemSupport(), SERVICE);
final TicketGrantingTicket tId = getCentralAuthenticationService().createTicketGrantingTicket(ctx);
getCentralAuthenticationService().grantServiceTicket(tId.getId(), SERVICE, ctx);
final ServiceTicket sId2 = getCentralAuthenticationService().grantServiceTicket(tId.getId(), SERVICE, null);
final MockHttpServletRequest request = new MockHttpServletRequest();
request.addParameter(SERVICE_PARAM, SERVICE.getId());
request.addParameter(TICKET_PARAM, sId2.getId());
request.addParameter("renew", "true");
return request;
}
Aggregations