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

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

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