Search in sources :

Example 1 with EventListenerTree

use of org.motechproject.event.listener.impl.EventListenerTree in project motech by motech.

the class EventListenerRegistryTest method testEmptyEventListRegistration.

@Test
public void testEmptyEventListRegistration() throws NoSuchFieldException {
    List<String> subjects = new ArrayList<String>();
    EventListener sel = new SampleEventListener();
    EventListenerTree mockTree = mock(EventListenerTree.class);
    PrivateAccessor.setField(registry, "listenerTree", mockTree);
    registry.registerListener(sel, subjects);
    verify(mockTree, times(0)).addListener(Matchers.<EventListener>anyObject(), anyString());
}
Also used : EventListenerTree(org.motechproject.event.listener.impl.EventListenerTree) ArrayList(java.util.ArrayList) Matchers.anyString(org.mockito.Matchers.anyString) OtherSampleEventListener(org.motechproject.event.listener.OtherSampleEventListener) EventListener(org.motechproject.event.listener.EventListener) SampleEventListener(org.motechproject.event.listener.SampleEventListener) OtherSampleEventListener(org.motechproject.event.listener.OtherSampleEventListener) SampleEventListener(org.motechproject.event.listener.SampleEventListener) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 Matchers.anyString (org.mockito.Matchers.anyString)1 EventListener (org.motechproject.event.listener.EventListener)1 OtherSampleEventListener (org.motechproject.event.listener.OtherSampleEventListener)1 SampleEventListener (org.motechproject.event.listener.SampleEventListener)1 EventListenerTree (org.motechproject.event.listener.impl.EventListenerTree)1