urbanairship-core/src/test/java/com/urbanairship/richpush/RichPushMessageTest.java
@Test
    public void testMessageExpiry() throws JsonException {
        // Add expiry
        Map<String, JsonValue> map = JsonValue.parseString(MCRAP_MESSAGE).getMap().getMap();
        map.put("message_expiry", JsonValue.wrap(DateUtils.createIso8601TimeStamp(10000l)));

        RichPushMessage message = RichPushMessage.create(JsonValue.wrap(map), true, false);

        // Expiry
        assertEquals(10000l, message.getExpirationDateMS().longValue());
        assertTrue(message.isExpired());
    }
/**
     * Test message parses its data correctly.
     */
Test message parses its data correctly.
Test message parses its data correctly .
@Test
    public void testMessageExpiry() throws JsonException {
        Map<String, JsonValue> map = JsonValue.parseString(MCRAP_MESSAGE).getMap().getMap();
        map.put("message_expiry", JsonValue.wrap(DateUtils.createIso8601TimeStamp(10000l)));
        RichPushMessage message = RichPushMessage.create(JsonValue.wrap(map), true, false);
        assertEquals(10000l, message.getExpirationDateMS().longValue());
        assertTrue(message.isExpired());
    }
@ Test public void testMessageExpiry ( ) throws JsonException { Map < String , JsonValue > map = JsonValue . parseString ( MCRAP_MESSAGE ) . getMap ( ) . getMap ( ) ; map . put ( "message_expiry" , JsonValue . wrap ( DateUtils . createIso8601TimeStamp ( 10000l ) ) ) ; RichPushMessage message = RichPushMessage . create ( JsonValue . wrap ( map ) , true , false ) ; assertEquals ( 10000l , message . getExpirationDateMS ( ) . longValue ( ) ) ; assertTrue ( message . isExpired ( ) ) ; }
Test message parses its data correctly.
Test message parses its data correctly .
// Add expiry // Expiry