Search in sources :

Example 1 with SimbaEvent

use of org.simbasecurity.common.event.SimbaEvent in project simba-os by cegeka.

the class RefreshCacheEventListenerTest method onMessage_UserAuthorizationChanged.

@Test
public void onMessage_UserAuthorizationChanged() throws Exception {
    SimbaEvent event = new SimbaEvent(SimbaEventType.USER_AUTHORIZATION_CHANGED, USERNAME);
    ObjectMessage message = mock(ObjectMessage.class);
    when(message.getObject()).thenReturn(event);
    listener.onMessage(message);
    verify(service).invalidate(USERNAME);
}
Also used : ObjectMessage(javax.jms.ObjectMessage) SimbaEvent(org.simbasecurity.common.event.SimbaEvent) Test(org.junit.Test)

Example 2 with SimbaEvent

use of org.simbasecurity.common.event.SimbaEvent in project simba-os by cegeka.

the class RefreshCacheEventListenerTest method onMessage_AuthorizationChanged.

@Test
public void onMessage_AuthorizationChanged() throws Exception {
    SimbaEvent event = new SimbaEvent(SimbaEventType.AUTHORIZATION_CHANGED, null);
    ObjectMessage message = mock(ObjectMessage.class);
    when(message.getObject()).thenReturn(event);
    listener.onMessage(message);
    verify(service).invalidate();
}
Also used : ObjectMessage(javax.jms.ObjectMessage) SimbaEvent(org.simbasecurity.common.event.SimbaEvent) Test(org.junit.Test)

Aggregations

ObjectMessage (javax.jms.ObjectMessage)2 Test (org.junit.Test)2 SimbaEvent (org.simbasecurity.common.event.SimbaEvent)2