use of org.apereo.cas.util.PublisherIdentifier in project cas by apereo.
the class RegisteredServiceHazelcastDistributedCacheManagerTests method verifyAction.
@Test
public void verifyAction() {
val registeredService = RegisteredServiceTestUtils.getRegisteredService();
var obj = mgr.get(registeredService);
assertNull(obj);
assertFalse(mgr.contains(registeredService));
val id = new PublisherIdentifier();
val cache = DistributedCacheObject.<RegisteredService>builder().value(registeredService).publisherIdentifier(id).build();
mgr.set(registeredService, cache, true);
assertFalse(mgr.getAll().isEmpty());
obj = mgr.get(registeredService);
assertNotNull(obj);
val c = mgr.findAll(obj1 -> obj1.getValue().equals(registeredService));
assertFalse(c.isEmpty());
mgr.remove(registeredService, cache, true);
assertTrue(mgr.getAll().isEmpty());
}
use of org.apereo.cas.util.PublisherIdentifier in project cas by apereo.
the class JmsTicketRegistryConfiguration method messageQueueTicketRegistryIdentifier.
@ConditionalOnMissingBean(name = "messageQueueTicketRegistryIdentifier")
@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
public PublisherIdentifier messageQueueTicketRegistryIdentifier(final CasConfigurationProperties casProperties) {
val bean = new PublisherIdentifier();
val jms = casProperties.getTicket().getRegistry().getJms();
if (StringUtils.isNotBlank(jms.getQueueIdentifier())) {
bean.setId(jms.getQueueIdentifier());
}
return bean;
}
use of org.apereo.cas.util.PublisherIdentifier 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());
}
use of org.apereo.cas.util.PublisherIdentifier 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