use of org.apereo.cas.ticket.registry.TicketRegistry in project cas by apereo.
the class SessionHealthIndicatorTests method addTicketsToRegistry.
private static void addTicketsToRegistry(final TicketRegistry registry, final int tgtCount, final int stCount) {
val ticket = new TicketGrantingTicketImpl[] { null };
IntStream.range(0, tgtCount).forEach(Unchecked.intConsumer(i -> {
ticket[0] = new TicketGrantingTicketImpl(GENERATOR.getNewTicketId("TGT"), CoreAuthenticationTestUtils.getAuthentication(), TEST_EXP_POLICY);
registry.addTicket(ticket[0]);
}));
if (ticket[0] != null) {
val testService = getService("junit");
IntStream.range(0, stCount).forEach(Unchecked.intConsumer(i -> registry.addTicket(ticket[0].grantServiceTicket(GENERATOR.getNewTicketId("ST"), testService, TEST_EXP_POLICY, false, true))));
}
}
Aggregations