use of org.apereo.cas.util.TicketGrantingTicketIdGenerator in project cas by apereo.
the class JpaTicketRegistryTests method verifyLargeDataset.
@RepeatedTest(2)
public void verifyLargeDataset() throws Exception {
val ticketGrantingTickets = Stream.generate(() -> {
var ticketGrantingTicketId = new TicketGrantingTicketIdGenerator(10, StringUtils.EMPTY).getNewTicketId(TicketGrantingTicket.PREFIX);
return new TicketGrantingTicketImpl(ticketGrantingTicketId, CoreAuthenticationTestUtils.getAuthentication(), NeverExpiresExpirationPolicy.INSTANCE);
}).limit(COUNT);
var stopwatch = new StopWatch();
stopwatch.start();
newTicketRegistry.addTicket(ticketGrantingTickets);
assertEquals(COUNT, newTicketRegistry.getTickets().size());
stopwatch.stop();
var time = stopwatch.getTime(TimeUnit.SECONDS);
assertTrue(time <= 20);
}
Aggregations