urbanairship-core/src/test/java/com/urbanairship/iam/InAppMessageEventTest.java
@Test
    public void testLegacyMessage() throws JSONException {
        UAirship.shared().getAnalytics().setConversionSendId("send id");
        UAirship.shared().getAnalytics().setConversionMetadata("metadata");

        JsonMap expectedEventData = JsonMap.newBuilder()
                                           .put("id", "message id")
                                           .put("source", "urban-airship")
                                           .put("conversion_send_id", "send id")
                                           .put("conversion_metadata", "metadata")
                                           .build();

        TestEvent event = new TestEvent(legacyInAppMessage);
        assertEquals(expectedEventData, EventTestUtils.getEventData(event));
        assertTrue(event.isValid());
    }
/**
     * Test display event from a legacy in-app message.
     */
Test display event from a legacy in-app message.
Test display event from a legacy in - app message .
@Test
    public void testLegacyMessage() throws JSONException {
        UAirship.shared().getAnalytics().setConversionSendId("send id");
        UAirship.shared().getAnalytics().setConversionMetadata("metadata");
        JsonMap expectedEventData = JsonMap.newBuilder()
                                           .put("id", "message id")
                                           .put("source", "urban-airship")
                                           .put("conversion_send_id", "send id")
                                           .put("conversion_metadata", "metadata")
                                           .build();
        TestEvent event = new TestEvent(legacyInAppMessage);
        assertEquals(expectedEventData, EventTestUtils.getEventData(event));
        assertTrue(event.isValid());
    }
@ Test public void testLegacyMessage ( ) throws JSONException { UAirship . shared ( ) . getAnalytics ( ) . setConversionSendId ( "send id" ) ; UAirship . shared ( ) . getAnalytics ( ) . setConversionMetadata ( "metadata" ) ; JsonMap expectedEventData = JsonMap . newBuilder ( ) . put ( "id" , "message id" ) . put ( "source" , "urban-airship" ) . put ( "conversion_send_id" , "send id" ) . put ( "conversion_metadata" , "metadata" ) . build ( ) ; TestEvent event = new TestEvent ( legacyInAppMessage ) ; assertEquals ( expectedEventData , EventTestUtils . getEventData ( event ) ) ; assertTrue ( event . isValid ( ) ) ; }
Test display event from a legacy in-app message.
Test display event from a legacy in - app message .