urbanairship-core/src/test/java/com/urbanairship/analytics/CustomEventTest.java
@Test
    public void testAttributionFromPushMessage() throws JSONException {
        Bundle pushBundle = new Bundle();
        pushBundle.putString(PushMessage.EXTRA_SEND_ID, "send id");
        PushMessage pushMessage = new PushMessage(pushBundle);

        CustomEvent event = CustomEvent.newBuilder("event name")
                .setAttribution(pushMessage)
                .build();

        EventTestUtils.validateEventValue(event, "conversion_send_id", "send id");
    }
/**
     * Test setting the attribution directly from a push message.
     */
Test setting the attribution directly from a push message.
Test setting the attribution directly from a push message .
@Test
    public void testAttributionFromPushMessage() throws JSONException {
        Bundle pushBundle = new Bundle();
        pushBundle.putString(PushMessage.EXTRA_SEND_ID, "send id");
        PushMessage pushMessage = new PushMessage(pushBundle);
        CustomEvent event = CustomEvent.newBuilder("event name")
                .setAttribution(pushMessage)
                .build();
        EventTestUtils.validateEventValue(event, "conversion_send_id", "send id");
    }
@ Test public void testAttributionFromPushMessage ( ) throws JSONException { Bundle pushBundle = new Bundle ( ) ; pushBundle . putString ( PushMessage . EXTRA_SEND_ID , "send id" ) ; PushMessage pushMessage = new PushMessage ( pushBundle ) ; CustomEvent event = CustomEvent . newBuilder ( "event name" ) . setAttribution ( pushMessage ) . build ( ) ; EventTestUtils . validateEventValue ( event , "conversion_send_id" , "send id" ) ; }
Test setting the attribution directly from a push message.
Test setting the attribution directly from a push message .