Search in sources :

Example 1 with UpdateTicketMessageQueueCommand

use of org.apereo.cas.ticket.queue.UpdateTicketMessageQueueCommand in project cas by apereo.

the class JmsTicketRegistry method updateTicket.

@Override
public Ticket updateTicket(final Ticket ticket) throws Exception {
    val result = super.updateTicket(ticket);
    LOGGER.trace("Publishing update command for id [{}] and ticket [{}]", id, ticket.getId());
    ticketPublisher.publishMessageToQueue(new UpdateTicketMessageQueueCommand(id, ticket));
    return result;
}
Also used : lombok.val(lombok.val) UpdateTicketMessageQueueCommand(org.apereo.cas.ticket.queue.UpdateTicketMessageQueueCommand)

Example 2 with UpdateTicketMessageQueueCommand

use of org.apereo.cas.ticket.queue.UpdateTicketMessageQueueCommand in project cas by apereo.

the class UpdateTicketMessageQueueCommandTests method verifyUpdateTicket.

@Test
public void verifyUpdateTicket() throws Exception {
    var ticket = new TicketGrantingTicketImpl("TGT", CoreAuthenticationTestUtils.getAuthentication(), NeverExpiresExpirationPolicy.INSTANCE);
    val cmd = new UpdateTicketMessageQueueCommand(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) UpdateTicketMessageQueueCommand(org.apereo.cas.ticket.queue.UpdateTicketMessageQueueCommand) TicketGrantingTicketImpl(org.apereo.cas.ticket.TicketGrantingTicketImpl) PublisherIdentifier(org.apereo.cas.util.PublisherIdentifier) Test(org.junit.jupiter.api.Test)

Aggregations

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