Search in sources :

Example 1 with LightSignalManager

use of io.automatiko.engine.services.signal.LightSignalManager in project automatiko-engine by automatiko-io.

the class LightSignalManagerTest method testAddNewListener.

@Test
public void testAddNewListener() {
    LightSignalManager sm = new LightSignalManager(mock(EventListenerResolver.class), mock(SignalManagerHub.class));
    EventListener listen = mock(EventListener.class);
    String type = "completion";
    sm.addEventListener(type, listen);
    assertThat(sm.getListeners()).hasEntrySatisfying(type, s -> assertThat(s).hasSize(1));
    sm.addEventListener(type, listen);
    assertThat(sm.getListeners()).hasEntrySatisfying(type, s -> assertThat(s).hasSize(1));
}
Also used : EventListenerResolver(io.automatiko.engine.services.signal.EventListenerResolver) SignalManagerHub(io.automatiko.engine.api.workflow.signal.SignalManagerHub) LightSignalManager(io.automatiko.engine.services.signal.LightSignalManager) EventListener(io.automatiko.engine.api.runtime.process.EventListener) Test(org.junit.jupiter.api.Test)

Aggregations

EventListener (io.automatiko.engine.api.runtime.process.EventListener)1 SignalManagerHub (io.automatiko.engine.api.workflow.signal.SignalManagerHub)1 EventListenerResolver (io.automatiko.engine.services.signal.EventListenerResolver)1 LightSignalManager (io.automatiko.engine.services.signal.LightSignalManager)1 Test (org.junit.jupiter.api.Test)1