use of org.apereo.cas.ticket.ProxyGrantingTicketImpl in project cas by apereo.
the class ProxyControllerTests method verifyNotAuthorizedPGT.
@Test
public void verifyNotAuthorizedPGT() throws Exception {
final ProxyGrantingTicket ticket = new ProxyGrantingTicketImpl("ticketGrantingTicketId", CoreAuthenticationTestUtils.getAuthentication(), new NeverExpiresExpirationPolicy());
getTicketRegistry().addTicket(ticket);
final MockHttpServletRequest request = new MockHttpServletRequest();
request.addParameter(CasProtocolConstants.PARAMETER_PROXY_GRANTING_TICKET, ticket.getId());
request.addParameter("targetService", "service");
final Map<String, Object> map = this.proxyController.handleRequestInternal(request, new MockHttpServletResponse()).getModel();
assertFalse(map.containsKey(CasProtocolConstants.PARAMETER_TICKET));
}
use of org.apereo.cas.ticket.ProxyGrantingTicketImpl in project cas by apereo.
the class ProxyControllerTests method verifyExistingPGT.
@Test
public void verifyExistingPGT() throws Exception {
final ProxyGrantingTicket ticket = new ProxyGrantingTicketImpl("ticketGrantingTicketId", CoreAuthenticationTestUtils.getAuthentication(), new NeverExpiresExpirationPolicy());
getTicketRegistry().addTicket(ticket);
final MockHttpServletRequest request = new MockHttpServletRequest();
request.addParameter(CasProtocolConstants.PARAMETER_PROXY_GRANTING_TICKET, ticket.getId());
request.addParameter("targetService", "testDefault");
assertTrue(this.proxyController.handleRequestInternal(request, new MockHttpServletResponse()).getModel().containsKey(CasProtocolConstants.PARAMETER_TICKET));
}
Aggregations