Search in sources :

Example 1 with DeleteTicketsMessageQueueCommand

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

the class JmsTicketRegistry method deleteAll.

@Override
public long deleteAll() {
    val result = super.deleteAll();
    ticketPublisher.publishMessageToQueue(new DeleteTicketsMessageQueueCommand(id));
    return result;
}
Also used : lombok.val(lombok.val) DeleteTicketsMessageQueueCommand(org.apereo.cas.ticket.queue.DeleteTicketsMessageQueueCommand)

Example 2 with DeleteTicketsMessageQueueCommand

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

the class DeleteTicketsMessageQueueCommandTests method verifyDeleteTickets.

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

Aggregations

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