urbanairship-core/src/test/java/com/urbanairship/analytics/CustomEventTest.java
@Test
    public void testInteractionFromMessage() throws JSONException {
        RichPushMessage message = mock(RichPushMessage.class);
        when(message.getMessageId()).thenReturn("message id");

        CustomEvent event = CustomEvent.newBuilder("event name")
                .setInteraction(message)
                .build();

        EventTestUtils.validateEventValue(event, "interaction_id", "message id");
        EventTestUtils.validateEventValue(event, "interaction_type", "ua_mcrap");
    }
/**
     * Test adding a custom event with interaction from a message.
     */
Test adding a custom event with interaction from a message.
Test adding a custom event with interaction from a message .
@Test
    public void testInteractionFromMessage() throws JSONException {
        RichPushMessage message = mock(RichPushMessage.class);
        when(message.getMessageId()).thenReturn("message id");
        CustomEvent event = CustomEvent.newBuilder("event name")
                .setInteraction(message)
                .build();
        EventTestUtils.validateEventValue(event, "interaction_id", "message id");
        EventTestUtils.validateEventValue(event, "interaction_type", "ua_mcrap");
    }
@ Test public void testInteractionFromMessage ( ) throws JSONException { RichPushMessage message = mock ( RichPushMessage . class ) ; when ( message . getMessageId ( ) ) . thenReturn ( "message id" ) ; CustomEvent event = CustomEvent . newBuilder ( "event name" ) . setInteraction ( message ) . build ( ) ; EventTestUtils . validateEventValue ( event , "interaction_id" , "message id" ) ; EventTestUtils . validateEventValue ( event , "interaction_type" , "ua_mcrap" ) ; }
Test adding a custom event with interaction from a message.
Test adding a custom event with interaction from a message .