package net.kencochrane.raven.event;

import mockit.Injectable;
import mockit.NonStrictExpectations;
import org.testng.annotations.Test;

import java.util.UUID;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.sameInstance;

public class EventBuilderTest2 {
    @Test
    public void buildedEventHasRandomlyGeneratedUuid(@Injectable final UUID mockUuid) throws Exception {
        new NonStrictExpectations(UUID.class) {{
            UUID.randomUUID();
            result = mockUuid;
        }};
        final EventBuilder eventBuilder = new EventBuilder();

        final Event event = eventBuilder.build();

        assertThat(event.getId(), is(sameInstance(mockUuid)));
    }

    @Test
    public void buildedEventWithCustomUuidHasProperUuid(@Injectable UUID mockUuid) throws Exception {
        final EventBuilder eventBuilder = new EventBuilder(mockUuid);

        final Event event = eventBuilder.build();

        assertThat(event.getId(), is(sameInstance(mockUuid)));
    }

    @Test
    public void buildedEventWithMessageHasProperMessage(@Injectable("message") String mockMessage) throws Exception {
        final EventBuilder eventBuilder = new EventBuilder();
        eventBuilder.setMessage(mockMessage);

        final Event event = eventBuilder.build();

        assertThat(event.getMessage(), is(sameInstance(mockMessage)));
    }
}

@@ -358,27 +358,25 @@
 ic void buil
-ded
+t
 EventHasRand
@@ -417,32 +417,44 @@
 l UUID mockUuid)
+%0A           
  throws Exceptio
@@ -786,35 +786,33 @@
 public void buil
-ded
+t
 EventWithCustomU
@@ -840,16 +840,22 @@
 ectable 
+final 
 UUID moc
@@ -860,16 +860,28 @@
 ockUuid)
+%0A           
  throws 
@@ -1118,11 +1118,9 @@
 buil
-ded
+t
 Even
@@ -1148,16 +1148,29 @@
 Message(
+%0A            
 @Injecta
@@ -1183,16 +1183,22 @@
 essage%22)
+ final
  String 
@@ -1209,16 +1209,28 @@
 Message)
+%0A           
  throws 

Fix typo and indentation