use of org.wso2.carbon.identity.event.bean.IdentityEventMessageContext in project carbon-identity-framework by wso2.
the class IdentityEventMessageContextTest method testSetEvent.
@Test
public void testSetEvent() {
Event setEvent = new Event("setEvent");
IdentityEventMessageContext identityEventMessageContext = new IdentityEventMessageContext(event);
identityEventMessageContext.setEvent(setEvent);
Assert.assertEquals(identityEventMessageContext.getEvent(), setEvent);
}
use of org.wso2.carbon.identity.event.bean.IdentityEventMessageContext in project carbon-identity-framework by wso2.
the class AbstractEventHandlerTest method testCanHandle.
@Test
public void testCanHandle() throws IdentityEventException {
Event event = new Event("eventName");
IdentityEventMessageContext messageContext = new IdentityEventMessageContext(event);
TestEventHandler testEventHandler = new TestEventHandler();
testEventHandler.init(moduleConfiguration);
boolean canHandle = testEventHandler.canHandle(messageContext);
Assert.assertFalse(canHandle);
subscriptionList.add(new Subscription("eventName", new Properties()));
canHandle = testEventHandler.canHandle(messageContext);
Assert.assertTrue(canHandle);
}
use of org.wso2.carbon.identity.event.bean.IdentityEventMessageContext in project identity-governance by wso2-extensions.
the class CodeInvalidationHandler method canHandle.
public boolean canHandle(MessageContext messageContext) throws IdentityRuntimeException {
Event event = ((IdentityEventMessageContext) messageContext).getEvent();
String eventName = event.getEventName();
if (IdentityEventConstants.Event.POST_DELETE_USER.equals(eventName)) {
return true;
}
return false;
}
Aggregations