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;

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(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(mockUuid));
    }
}

@@ -247,16 +247,66 @@
 hers.is;
+%0Aimport static org.hamcrest.Matchers.sameInstance;
 %0A%0Apublic
@@ -713,32 +713,45 @@
 ent.getId(), is(
+sameInstance(
 mockUuid));%0A    
@@ -736,32 +736,33 @@
 tance(mockUuid))
+)
 ;%0A    %7D%0A%0A    @Te
@@ -1025,16 +1025,29 @@
 d(), is(
+sameInstance(
 mockUuid
@@ -1048,16 +1048,17 @@
 ckUuid))
+)
 ;%0A    %7D%0A

Ensure that expected element are the same exact instance