use of org.apereo.cas.ticket.ServiceTicketFactory in project cas by apereo.
the class DefaultServiceTicketFactoryTests method verifyDefaultExpirationPolicy.
@Test
public void verifyDefaultExpirationPolicy() {
val svc = RegisteredServiceTestUtils.getRegisteredService("defaultExpirationPolicy", RegexRegisteredService.class);
servicesManager.save(svc);
val factory = (ServiceTicketFactory) this.ticketFactory.get(ServiceTicket.class);
val serviceTicket = factory.create(new MockTicketGrantingTicket("casuser"), RegisteredServiceTestUtils.getService("defaultExpirationPolicy"), true, ServiceTicket.class);
assertNotNull(serviceTicket);
assertEquals(10, serviceTicket.getExpirationPolicy().getTimeToLive());
}
Aggregations