package net.kencochrane.raven;

import net.kencochrane.raven.connection.Connection;
import net.kencochrane.raven.event.Event;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

public class RavenTest {
    @Mock
    private Connection mockConnection;
    private Raven raven;

    @Before
    public void setUp() {
        MockitoAnnotations.initMocks(this);
        raven = new Raven(mockConnection);
    }

    @Test
    public void testSendEvent() {
        Event event = mock(Event.class);
        raven.sendEvent(event);

        verify(mockConnection).send(event);
    }
}

@@ -119,16 +119,127 @@
 .Event;%0A
+import net.kencochrane.raven.event.EventBuilder;%0Aimport net.kencochrane.raven.event.helper.EventBuilderHelper;%0A
 import o
@@ -365,28 +365,128 @@
 org.
-mockito.Mockito.mock
+hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.Matchers.contains;%0Aimport static org.hamcrest.Matchers.not
 ;%0Aim
@@ -517,22 +517,17 @@
 Mockito.
-verify
+*
 ;%0A%0Apubli
@@ -920,11 +920,1425 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testChangeConnection() %7B%0A        Event event = mock(Event.class);%0A        Connection mockNewConnection = mock(Connection.class);%0A%0A        raven.setConnection(mockNewConnection);%0A        raven.sendEvent(event);%0A%0A        verify(mockConnection, never()).send(event);%0A        verify(mockNewConnection).send(event);%0A    %7D%0A%0A    @Test%0A    public void testAddRemoveBuilderHelpers() %7B%0A        EventBuilderHelper builderHelper = mock(EventBuilderHelper.class);%0A        assertThat(raven.getBuilderHelpers(), not(contains(builderHelper)));%0A%0A        raven.addBuilderHelper(builderHelper);%0A        assertThat(raven.getBuilderHelpers(), contains(builderHelper));%0A        raven.removeBuilderHelper(builderHelper);%0A        assertThat(raven.getBuilderHelpers(), not(contains(builderHelper)));%0A    %7D%0A%0A    @Test(expected = UnsupportedOperationException.class)%0A    public void testCantModifyBuilderHelpersDirectly() %7B%0A        EventBuilderHelper builderHelper = mock(EventBuilderHelper.class);%0A        raven.getBuilderHelpers().add(builderHelper);%0A    %7D%0A%0A    @Test%0A    public void testRunBuilderHelpers() %7B%0A        EventBuilder eventBuilder = mock(EventBuilder.class);%0A        EventBuilderHelper builderHelper = mock(EventBuilderHelper.class);%0A        raven.addBuilderHelper(builderHelper);%0A%0A        raven.runBuilderHelpers(eventBuilder);%0A%0A        verify(builderHelper).helpBuildingEvent(eventBuilder);%0A    %7D
 %0A%7D%0A

Add unit tests for Raven