use of org.apereo.cas.ticket.support.NeverExpiresExpirationPolicy in project cas by apereo.
the class TicketGrantingTicketImplTests method verifyGetChainedPrincipalsWithTwo.
@Test
public void verifyGetChainedPrincipalsWithTwo() {
final Authentication authentication = CoreAuthenticationTestUtils.getAuthentication();
final Authentication authentication1 = CoreAuthenticationTestUtils.getAuthentication("test1");
final List<Authentication> principals = new ArrayList<>();
principals.add(authentication);
principals.add(authentication1);
final TicketGrantingTicketImpl t1 = new TicketGrantingTicketImpl(TGT_ID, null, null, authentication1, new NeverExpiresExpirationPolicy());
final TicketGrantingTicket t = new TicketGrantingTicketImpl(TGT_ID, CoreAuthenticationTestUtils.getService("gantor"), t1, authentication, new NeverExpiresExpirationPolicy());
assertEquals(principals, t.getChainedAuthentications());
}
use of org.apereo.cas.ticket.support.NeverExpiresExpirationPolicy in project cas by apereo.
the class TicketGrantingTicketImplTests method verifyServiceTicketAsFromInitialCredentials.
@Test
public void verifyServiceTicketAsFromInitialCredentials() {
final TicketGrantingTicket t = new TicketGrantingTicketImpl(TGT_ID, null, null, CoreAuthenticationTestUtils.getAuthentication(), new NeverExpiresExpirationPolicy());
final ServiceTicket s = t.grantServiceTicket(ID_GENERATOR.getNewTicketId(ServiceTicket.PREFIX), RegisteredServiceTestUtils.getService(), new NeverExpiresExpirationPolicy(), false, true);
assertTrue(s.isFromNewLogin());
}
use of org.apereo.cas.ticket.support.NeverExpiresExpirationPolicy in project cas by apereo.
the class TicketGrantingTicketImplTests method verifyDoubleGrantSimilarServiceWithPathTicketKeepMostRecentSession.
@Test
public void verifyDoubleGrantSimilarServiceWithPathTicketKeepMostRecentSession() {
final TicketGrantingTicket t = new TicketGrantingTicketImpl(TGT_ID, null, null, CoreAuthenticationTestUtils.getAuthentication(), new NeverExpiresExpirationPolicy());
t.grantServiceTicket(ID_GENERATOR.getNewTicketId(ServiceTicket.PREFIX), RegisteredServiceTestUtils.getService("http://host.com/webapp1"), new NeverExpiresExpirationPolicy(), false, true);
t.grantServiceTicket(ID_GENERATOR.getNewTicketId(ServiceTicket.PREFIX), RegisteredServiceTestUtils.getService("http://host.com/webapp1?test=true"), new NeverExpiresExpirationPolicy(), false, true);
assertEquals(1, t.getServices().size());
}
use of org.apereo.cas.ticket.support.NeverExpiresExpirationPolicy in project cas by apereo.
the class ServiceTicketImplTests method verifyGetService.
@Test
public void verifyGetService() {
final Service simpleService = CoreAuthenticationTestUtils.getService();
final ServiceTicket s = new ServiceTicketImpl(ST_ID, tgt, simpleService, false, new NeverExpiresExpirationPolicy());
assertEquals(simpleService, s.getService());
}
use of org.apereo.cas.ticket.support.NeverExpiresExpirationPolicy in project cas by apereo.
the class ServiceTicketImplTests method verifyIsFromNewLoginTrue.
@Test
public void verifyIsFromNewLoginTrue() {
final ServiceTicket s = new ServiceTicketImpl(ST_ID, tgt, CoreAuthenticationTestUtils.getService(), true, new NeverExpiresExpirationPolicy());
assertTrue(s.isFromNewLogin());
}
Aggregations