use of org.wso2.carbon.identity.mgt.IdentityMgtEventListener in project identity-governance by wso2-extensions.
the class IdentityMgtEventListenerTest method mockHandleEvent.
private void mockHandleEvent() throws Exception {
identityMgtEventListener = spy(IdentityMgtEventListener.class);
userStoreManager = Mockito.mock(UserStoreManager.class);
realmConfiguration = Mockito.mock(RealmConfiguration.class);
tenantManager = Mockito.mock(TenantManager.class);
when(realmService.getTenantManager()).thenReturn(tenantManager);
when(tenantManager.getDomain(SAMPLE_TENANT_ID)).thenReturn(SAMPLE_TENANT_DOMAIN);
TestUtils.startTenantFlow(SAMPLE_TENANT_DOMAIN);
when(userStoreManager.getTenantId()).thenReturn(SAMPLE_TENANT_ID);
when(userStoreManager.getRealmConfiguration()).thenReturn(realmConfiguration);
when(realmConfiguration.getUserStoreProperty(UserCoreConstants.RealmConfig.PROPERTY_DOMAIN_NAME)).thenReturn("PRIMARY");
Map<String, Object> properties = new HashMap<>();
Event identityMgtEvent = new Event("sampleEvent", properties);
doNothing().when(identityEventService).handleEvent(any(Event.class));
identityEventService.handleEvent(identityMgtEvent);
}
Aggregations