package net.kencochrane.raven;

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

import static org.mockito.Matchers.any;
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() {
        LoggedEvent loggedEvent = mock(LoggedEvent.class);
        raven.sendEvent(loggedEvent);

        verify(mockConnection).send(loggedEvent);
    }

    @Test
    public void testSendEventBuilder() {
        EventBuilder eventBuilder = mock(EventBuilder.class);
        raven.sendEvent(eventBuilder);

        verify(eventBuilder).build();
        verify(mockConnection).send(any(LoggedEvent.class));
    }
}

@@ -174,16 +174,41 @@
 dEvent;%0A
+import org.junit.Assert;%0A
 import o
@@ -312,16 +312,85 @@
 tions;%0A%0A
+import java.util.UUID;%0A%0Aimport static org.junit.Assert.assertEquals;%0A
 import s
@@ -502,16 +502,56 @@
 .verify;
+%0Aimport static org.mockito.Mockito.when;
 %0A%0Apublic
@@ -1087,32 +1087,262 @@
 .class);%0A       
+ LoggedEvent loggedEvent = mock(LoggedEvent.class);%0A        UUID mockUuid = UUID.randomUUID();%0A        when(eventBuilder.build()).thenReturn(loggedEvent);%0A        when(loggedEvent.getId()).thenReturn(mockUuid);%0A        UUID uuid =
  raven.sendEvent
@@ -1457,16 +1457,54 @@
 lass));%0A
+        assertEquals(mockUuid, uuid);%0A
     %7D%0A%7D%0A

Fix raven unit test