use of org.apereo.cas.ticket.queue.AddTicketMessageQueueCommand in project cas by apereo.
the class JmsTicketRegistry method addTicketInternal.
@Override
public void addTicketInternal(@NonNull final Ticket ticket) throws Exception {
super.addTicketInternal(ticket);
LOGGER.trace("Publishing add command for id [{}] and ticket [{}]", id, ticket.getId());
ticketPublisher.publishMessageToQueue(new AddTicketMessageQueueCommand(id, ticket));
}
use of org.apereo.cas.ticket.queue.AddTicketMessageQueueCommand in project cas by apereo.
the class AddTicketMessageQueueCommandTests method verifyAddTicket.
@Test
public void verifyAddTicket() throws Exception {
var ticket = new TicketGrantingTicketImpl("TGT", CoreAuthenticationTestUtils.getAuthentication(), NeverExpiresExpirationPolicy.INSTANCE);
ticketRegistry.getObject().addTicket(ticket);
val cmd = new AddTicketMessageQueueCommand(new PublisherIdentifier(), ticket);
cmd.execute(ticketRegistry.getObject());
ticket = ticketRegistry.getObject().getTicket(ticket.getId(), ticket.getClass());
assertNotNull(ticket);
assertEquals("TGT", ticket.getId());
}
Aggregations