Search in sources :

Example 1 with AddTicketMessageQueueCommand

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));
}
Also used : AddTicketMessageQueueCommand(org.apereo.cas.ticket.queue.AddTicketMessageQueueCommand)

Example 2 with AddTicketMessageQueueCommand

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());
}
Also used : lombok.val(lombok.val) AddTicketMessageQueueCommand(org.apereo.cas.ticket.queue.AddTicketMessageQueueCommand) TicketGrantingTicketImpl(org.apereo.cas.ticket.TicketGrantingTicketImpl) PublisherIdentifier(org.apereo.cas.util.PublisherIdentifier) Test(org.junit.jupiter.api.Test)

Aggregations

AddTicketMessageQueueCommand (org.apereo.cas.ticket.queue.AddTicketMessageQueueCommand)2 lombok.val (lombok.val)1 TicketGrantingTicketImpl (org.apereo.cas.ticket.TicketGrantingTicketImpl)1 PublisherIdentifier (org.apereo.cas.util.PublisherIdentifier)1 Test (org.junit.jupiter.api.Test)1