Search in sources :

Example 1 with TestContentTwo

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

the class DefaultEntityEventManagerIntergationTest method testConfigPropertyEventTypeOverwrite.

@Test
public void testConfigPropertyEventTypeOverwrite() {
    String eventTypeName = getHelper().createName() + "_test_type";
    EventType type = (EventType) () -> eventTypeName;
    EntityEvent<TestContentTwo> event = new CoreEvent<>(type, new TestContentTwo());
    EventContext<TestContentTwo> context = manager.process(event);
    assertEquals(0, context.getResults().size());
    String configPropName = testTwoEntityEventProcessorOne.getConfigurationPropertyName(EntityEventProcessor.PROPERTY_EVENT_TYPES);
    getHelper().setConfigurationValue(configPropName, eventTypeName);
    EntityEvent<TestContentTwo> event2 = new CoreEvent<>(type, new TestContentTwo());
    EventContext<TestContentTwo> context2 = manager.process(event2);
    assertEquals(2, context2.getResults().size());
}
Also used : IdentityEventType(eu.bcvsolutions.idm.core.model.event.IdentityEvent.IdentityEventType) IdentityContractEventType(eu.bcvsolutions.idm.core.model.event.IdentityContractEvent.IdentityContractEventType) EventType(eu.bcvsolutions.idm.core.api.event.EventType) RoleRequestEventType(eu.bcvsolutions.idm.core.model.event.RoleRequestEvent.RoleRequestEventType) IdentityRoleEventType(eu.bcvsolutions.idm.core.model.event.IdentityRoleEvent.IdentityRoleEventType) CoreEventType(eu.bcvsolutions.idm.core.api.event.CoreEvent.CoreEventType) CoreEvent(eu.bcvsolutions.idm.core.api.event.CoreEvent) TestContentTwo(eu.bcvsolutions.idm.core.event.TestContentTwo) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 2 with TestContentTwo

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

the class DefaultEntityEventManagerIntergationTest method testProcessorSameOrder.

@Test
public void testProcessorSameOrder() {
    Assert.assertFalse(eventConfiguration.isAsynchronous());
    // 
    EntityEvent<TestContentTwo> event = new CoreEvent<>(CoreEventType.EAV_SAVE, new TestContentTwo());
    EventContext<TestContentTwo> context = manager.process(event);
    // 
    assertEquals(2, context.getResults().size());
    assertEquals(2, context.getProcessedOrder().intValue());
}
Also used : CoreEvent(eu.bcvsolutions.idm.core.api.event.CoreEvent) TestContentTwo(eu.bcvsolutions.idm.core.event.TestContentTwo) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Aggregations

CoreEvent (eu.bcvsolutions.idm.core.api.event.CoreEvent)2 TestContentTwo (eu.bcvsolutions.idm.core.event.TestContentTwo)2 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)2 Test (org.junit.Test)2 CoreEventType (eu.bcvsolutions.idm.core.api.event.CoreEvent.CoreEventType)1 EventType (eu.bcvsolutions.idm.core.api.event.EventType)1 IdentityContractEventType (eu.bcvsolutions.idm.core.model.event.IdentityContractEvent.IdentityContractEventType)1 IdentityEventType (eu.bcvsolutions.idm.core.model.event.IdentityEvent.IdentityEventType)1 IdentityRoleEventType (eu.bcvsolutions.idm.core.model.event.IdentityRoleEvent.IdentityRoleEventType)1 RoleRequestEventType (eu.bcvsolutions.idm.core.model.event.RoleRequestEvent.RoleRequestEventType)1 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)1