use of eu.bcvsolutions.idm.core.event.TestContent in project CzechIdMng by bcvsolutions.
the class DefaultEntityEventManagerIntergationTest method testCloseEvent.
@Test
public void testCloseEvent() {
EntityEvent<TestContent> event = new CoreEvent<>(CoreEventType.CREATE, new TestContent());
event.getContent().setClose(2);
EventContext<TestContent> context = entityEventManager.process(event);
//
assertEquals(2, context.getResults().size());
assertEquals(2, context.getProcessedOrder().intValue());
assertEquals("2", context.getLastResult().getEvent().getContent().getText());
}
use of eu.bcvsolutions.idm.core.event.TestContent in project CzechIdMng by bcvsolutions.
the class DefaultEntityEventManagerIntergationTest method testStartEventInMiddle.
@Test
public void testStartEventInMiddle() {
DefaultEventContext<TestContent> initContext = new DefaultEventContext<>();
initContext.setProcessedOrder(2);
EntityEvent<TestContent> event = new CoreEvent<>(CoreEventType.CREATE, new TestContent(), null, initContext);
EventContext<TestContent> context = entityEventManager.process(event);
//
assertEquals(2, context.getResults().size());
assertEquals(4, context.getProcessedOrder().intValue());
assertEquals("4", context.getLastResult().getEvent().getContent().getText());
}
use of eu.bcvsolutions.idm.core.event.TestContent in project CzechIdMng by bcvsolutions.
the class DefaultEntityEventManagerIntergationTest method testSameOrderBeansOrder.
@Test
public void testSameOrderBeansOrder() {
EntityEvent<TestContent> event = new CoreEvent<>(TestEntityEventProcessorConfiguration.EVENT_TYPE_ORDER, new TestContent());
EventContext<TestContent> context = entityEventManager.process(event);
//
// Look out: processors are executed in random order in configured order is same
assertEquals(7, context.getResults().size());
}
use of eu.bcvsolutions.idm.core.event.TestContent in project CzechIdMng by bcvsolutions.
the class DefaultEntityEventManagerIntergationTest method testSuspendEvent.
@Test
public void testSuspendEvent() {
EntityEvent<TestContent> event = new CoreEvent<>(CoreEventType.CREATE, new TestContent());
event.getContent().setSuspend(1);
EventContext<TestContent> context = entityEventManager.process(event);
//
assertEquals(1, context.getResults().size());
assertEquals(1, context.getProcessedOrder().intValue());
assertEquals("1", context.getLastResult().getEvent().getContent().getText());
//
event.getContent().setSuspend(3);
context = entityEventManager.process(event);
//
assertEquals(3, context.getResults().size());
assertEquals(3, context.getProcessedOrder().intValue());
assertEquals("3", context.getLastResult().getEvent().getContent().getText());
//
event.getContent().setSuspend(null);
context = entityEventManager.process(event);
//
assertEquals(4, context.getResults().size());
assertEquals(4, context.getProcessedOrder().intValue());
assertEquals("4", context.getLastResult().getEvent().getContent().getText());
}
use of eu.bcvsolutions.idm.core.event.TestContent in project CzechIdMng by bcvsolutions.
the class DefaultEntityEventManagerIntergationTest method testEventGreenLine.
@Test
public void testEventGreenLine() {
EntityEvent<TestContent> event = new CoreEvent<>(CoreEventType.CREATE, new TestContent());
EventContext<TestContent> context = entityEventManager.process(event);
//
assertEquals(4, context.getResults().size());
assertEquals(4, context.getProcessedOrder().intValue());
assertEquals("4", context.getLastResult().getEvent().getContent().getText());
}
Aggregations