Search in sources :

Example 1 with RoleEvent

use of eu.bcvsolutions.idm.core.model.event.RoleEvent in project CzechIdMng by bcvsolutions.

the class EntityEventProcessorUnitTest method testSupportAllIdentityEvents.

@Test
public void testSupportAllIdentityEvents() {
    EntityEventProcessor<?> processor = new EventProcessorIdentity();
    assertTrue(processor.supports(new IdentityEvent(IdentityEventType.CREATE, new IdmIdentityDto())));
    assertTrue(processor.supports(new IdentityEvent(IdentityEventType.UPDATE, new IdmIdentityDto())));
    assertTrue(processor.supports(new IdentityEvent(IdentityEventType.DELETE, new IdmIdentityDto())));
    assertFalse(processor.supports(new RoleEvent(RoleEventType.DELETE, new IdmRoleDto())));
    assertTrue(processor.supports(new CoreEvent<IdmIdentityDto>(CustomType.SAVE, new IdmIdentityDto())));
    assertTrue(processor.supports(new CoreEvent<>(CustomType.CUSTOM, new IdmIdentityDto())));
}
Also used : IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) IdentityEvent(eu.bcvsolutions.idm.core.model.event.IdentityEvent) CoreEvent(eu.bcvsolutions.idm.core.api.event.CoreEvent) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) RoleEvent(eu.bcvsolutions.idm.core.model.event.RoleEvent) AbstractVerifiableUnitTest(eu.bcvsolutions.idm.test.api.AbstractVerifiableUnitTest) Test(org.junit.Test)

Example 2 with RoleEvent

use of eu.bcvsolutions.idm.core.model.event.RoleEvent in project CzechIdMng by bcvsolutions.

the class EntityEventProcessorUnitTest method testSupportRoleDeleteOnly.

@Test
public void testSupportRoleDeleteOnly() {
    EntityEventProcessor<?> processor = new EventProcessorRole();
    assertFalse(processor.supports(new IdentityEvent(IdentityEventType.UPDATE, new IdmIdentityDto())));
    assertFalse(processor.supports(new IdentityEvent(IdentityEventType.DELETE, new IdmIdentityDto())));
    assertTrue(processor.supports(new RoleEvent(RoleEventType.DELETE, new IdmRoleDto())));
    assertFalse(processor.supports(new CoreEvent<IdmIdentityDto>(CustomType.SAVE, new IdmIdentityDto())));
    assertFalse(processor.supports(new CoreEvent<>(CustomType.CUSTOM, new IdmIdentityDto())));
    assertTrue(processor.supports(new CoreEvent<IdmRoleDto>(IdentityEventType.UPDATE, new IdmRoleDto())));
}
Also used : IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) IdentityEvent(eu.bcvsolutions.idm.core.model.event.IdentityEvent) CoreEvent(eu.bcvsolutions.idm.core.api.event.CoreEvent) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) RoleEvent(eu.bcvsolutions.idm.core.model.event.RoleEvent) AbstractVerifiableUnitTest(eu.bcvsolutions.idm.test.api.AbstractVerifiableUnitTest) Test(org.junit.Test)

Aggregations

IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)2 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)2 CoreEvent (eu.bcvsolutions.idm.core.api.event.CoreEvent)2 IdentityEvent (eu.bcvsolutions.idm.core.model.event.IdentityEvent)2 RoleEvent (eu.bcvsolutions.idm.core.model.event.RoleEvent)2 AbstractVerifiableUnitTest (eu.bcvsolutions.idm.test.api.AbstractVerifiableUnitTest)2 Test (org.junit.Test)2