use of org.apereo.cas.ticket.support.NeverExpiresExpirationPolicy in project cas by apereo.
the class ServiceTicketImplTests method verifyIsFromNewLoginFalse.
@Test
public void verifyIsFromNewLoginFalse() {
ServiceTicket s = tgt.grantServiceTicket(ST_ID, CoreAuthenticationTestUtils.getService(), new NeverExpiresExpirationPolicy(), false, false);
assertTrue(s.isFromNewLogin());
s = tgt.grantServiceTicket(ST_ID, CoreAuthenticationTestUtils.getService(), new NeverExpiresExpirationPolicy(), false, false);
assertFalse(s.isFromNewLogin());
}
use of org.apereo.cas.ticket.support.NeverExpiresExpirationPolicy in project cas by apereo.
the class ServiceTicketImplTests method verifyIsExpiredFalse.
@Test
public void verifyIsExpiredFalse() {
final TicketGrantingTicket t = new TicketGrantingTicketImpl(ID, CoreAuthenticationTestUtils.getAuthentication(), new NeverExpiresExpirationPolicy());
final ServiceTicket s = t.grantServiceTicket(idGenerator.getNewTicketId(ServiceTicket.PREFIX), CoreAuthenticationTestUtils.getService(), new MultiTimeUseOrTimeoutExpirationPolicy(1, 5000), false, true);
assertFalse(s.isExpired());
}
use of org.apereo.cas.ticket.support.NeverExpiresExpirationPolicy in project cas by apereo.
the class ServiceTicketImplTests method verifyTicketGrantingTicket.
@Test
public void verifyTicketGrantingTicket() throws AbstractTicketException {
final Authentication a = CoreAuthenticationTestUtils.getAuthentication();
final TicketGrantingTicket t = new TicketGrantingTicketImpl(ID, CoreAuthenticationTestUtils.getAuthentication(), new NeverExpiresExpirationPolicy());
final ServiceTicket s = t.grantServiceTicket(idGenerator.getNewTicketId(ServiceTicket.PREFIX), CoreAuthenticationTestUtils.getService(), new MultiTimeUseOrTimeoutExpirationPolicy(1, 5000), false, true);
final TicketGrantingTicket t1 = s.grantProxyGrantingTicket(idGenerator.getNewTicketId(TicketGrantingTicket.PREFIX), a, new NeverExpiresExpirationPolicy());
assertEquals(a, t1.getAuthentication());
}
use of org.apereo.cas.ticket.support.NeverExpiresExpirationPolicy in project cas by apereo.
the class ServiceTicketImplTests method verifyTicketGrantingTicketGrantedTwice.
@Test
public void verifyTicketGrantingTicketGrantedTwice() throws AbstractTicketException {
final Authentication a = CoreAuthenticationTestUtils.getAuthentication();
final TicketGrantingTicket t = new TicketGrantingTicketImpl(ID, CoreAuthenticationTestUtils.getAuthentication(), new NeverExpiresExpirationPolicy());
final ServiceTicket s = t.grantServiceTicket(idGenerator.getNewTicketId(ServiceTicket.PREFIX), CoreAuthenticationTestUtils.getService(), new MultiTimeUseOrTimeoutExpirationPolicy(1, 5000), false, true);
s.grantProxyGrantingTicket(idGenerator.getNewTicketId(TicketGrantingTicket.PREFIX), a, new NeverExpiresExpirationPolicy());
this.thrown.expect(Exception.class);
s.grantProxyGrantingTicket(idGenerator.getNewTicketId(TicketGrantingTicket.PREFIX), a, new NeverExpiresExpirationPolicy());
}
use of org.apereo.cas.ticket.support.NeverExpiresExpirationPolicy in project cas by apereo.
the class ServiceTicketImplTests method verifyIsExpiredTrueBecauseOfRoot.
@Test
public void verifyIsExpiredTrueBecauseOfRoot() {
final TicketGrantingTicket t = new TicketGrantingTicketImpl(ID, CoreAuthenticationTestUtils.getAuthentication(), new NeverExpiresExpirationPolicy());
final ServiceTicket s = t.grantServiceTicket(idGenerator.getNewTicketId(ServiceTicket.PREFIX), CoreAuthenticationTestUtils.getService(), new NeverExpiresExpirationPolicy(), false, true);
t.markTicketExpired();
assertTrue(s.isExpired());
}
Aggregations