Search in sources :

Example 1 with DeleteTicketMessageQueueCommand

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

the class DeleteTicketMessageQueueCommandTests method verifyDeleteTicket.

@Test
public void verifyDeleteTicket() throws Exception {
    val ticket = new TicketGrantingTicketImpl("TGT", CoreAuthenticationTestUtils.getAuthentication(), NeverExpiresExpirationPolicy.INSTANCE);
    ticketRegistry.getObject().addTicket(ticket);
    val cmd = new DeleteTicketMessageQueueCommand(new PublisherIdentifier(), ticket.getId());
    cmd.execute(ticketRegistry.getObject());
    assertTrue(ticketRegistry.getObject().getTickets().isEmpty());
}
Also used : lombok.val(lombok.val) DeleteTicketMessageQueueCommand(org.apereo.cas.ticket.queue.DeleteTicketMessageQueueCommand) TicketGrantingTicketImpl(org.apereo.cas.ticket.TicketGrantingTicketImpl) PublisherIdentifier(org.apereo.cas.util.PublisherIdentifier) Test(org.junit.jupiter.api.Test)

Example 2 with DeleteTicketMessageQueueCommand

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

the class JmsTicketRegistry method deleteSingleTicket.

@Override
public boolean deleteSingleTicket(final String ticketId) {
    val result = super.deleteSingleTicket(ticketId);
    LOGGER.trace("Publishing delete command for id [{}] and ticket [{}]", id, ticketId);
    ticketPublisher.publishMessageToQueue(new DeleteTicketMessageQueueCommand(id, ticketId));
    return result;
}
Also used : lombok.val(lombok.val) DeleteTicketMessageQueueCommand(org.apereo.cas.ticket.queue.DeleteTicketMessageQueueCommand)

Aggregations

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