@@ -0,0 +1,1936 @@
+package org.aanguita.jacuzzi.event.hub;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport static org.mockito.Mockito.*;%0A%0A/**%0A * Created by Alberto on 23/09/2016.%0A */%0Apublic class EventHubTest %7B%0A%0A    EventHub eventHub;%0A%0A    EventHubSubscriber mockedSubscriberAll;%0A%0A    EventHubSubscriber mockedSubscriberSome;%0A%0A    EventHubSubscriber mockedSubscriberOne;%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        eventHub = EventHub.getEventHub(%22test%22);%0A        mockedSubscriberAll = mock(EventHubSubscriber.class);%0A        mockedSubscriberSome = mock(EventHubSubscriber.class);%0A        mockedSubscriberOne = mock(EventHubSubscriber.class);%0A        when(mockedSubscriberAll.getId()).thenReturn(%22all%22);%0A        when(mockedSubscriberSome.getId()).thenReturn(%22some%22);%0A        when(mockedSubscriberOne.getId()).thenReturn(%22one%22);%0A        eventHub.subscribe(mockedSubscriberAll, %22*%22);%0A        eventHub.subscribe(mockedSubscriberSome, %22test/?%22);%0A        eventHub.subscribe(mockedSubscriberOne, %22test/one%22);%0A    %7D%0A%0A    @After%0A    public void tearDown() throws Exception %7B%0A%0A    %7D%0A%0A%0A    @Test%0A    public void test() %7B%0A%0A        String event1 = %22hello%22;%0A        String event2 = %22test/two%22;%0A        String event3 = %22test/one%22;%0A        Integer i = 5;%0A        Boolean b = true;%0A%0A        eventHub.publish(event1);%0A        eventHub.publish(event2, i);%0A        eventHub.publish(event3, i, b);%0A%0A        verify(mockedSubscriberAll).event(event1);%0A        verify(mockedSubscriberAll).event(event2, i);%0A        verify(mockedSubscriberAll).event(event3, i, b);%0A        verify(mockedSubscriberSome, never()).event(event1);%0A        verify(mockedSubscriberSome).event(event2, i);%0A        verify(mockedSubscriberSome).event(event3, i, b);%0A        verify(mockedSubscriberOne, never()).event(event1);%0A        verify(mockedSubscriberOne, never()).event(event2, i);%0A        verify(mockedSubscriberOne).event(event3, i, b);%0A    %7D%0A%7D

Add unit tests for EventHub