urbanairship-core/src/test/java/com/urbanairship/push/PushManagerTest.java
@Test
    public void testGetNextChannelRegistrationPayloadAmazon() throws JSONException {
        TestApplication.getApplication().setPlatform(UAirship.AMAZON_PLATFORM);

        pushManager.setChannel(fakeChannelId, fakeChannelLocation);
        pushManager.setRegistrationToken("ADM_ID");
        pushManager.setPushTokenRegistrationEnabled(true);

        ChannelRegistrationPayload payload = pushManager.getNextChannelRegistrationPayload();
        assertNotNull("The payload should not be null.", payload);
        assertEquals(payload.toJsonValue().getMap().get("channel").getMap().get("device_type").getString(), "amazon");
        assertEquals(payload.toJsonValue().getMap().get("channel").getMap().get("push_address").getString(), "ADM_ID");
        assertEquals(payload.toJsonValue().getMap().get("channel").getMap().get("locale_language").getString(),  Locale.getDefault().getLanguage());
        assertEquals(payload.toJsonValue().getMap().get("channel").getMap().get("locale_country").getString(), Locale.getDefault().getCountry());
    }
/**
     * Test getNextChannelRegistrationPayload returns a payload amazon device and ADM ID
     */
Test getNextChannelRegistrationPayload returns a payload amazon device and ADM ID
Test getNextChannelRegistrationPayload returns a payload amazon device and ADM ID
@Test
    public void testGetNextChannelRegistrationPayloadAmazon() throws JSONException {
        TestApplication.getApplication().setPlatform(UAirship.AMAZON_PLATFORM);
        pushManager.setChannel(fakeChannelId, fakeChannelLocation);
        pushManager.setRegistrationToken("ADM_ID");
        pushManager.setPushTokenRegistrationEnabled(true);
        ChannelRegistrationPayload payload = pushManager.getNextChannelRegistrationPayload();
        assertNotNull("The payload should not be null.", payload);
        assertEquals(payload.toJsonValue().getMap().get("channel").getMap().get("device_type").getString(), "amazon");
        assertEquals(payload.toJsonValue().getMap().get("channel").getMap().get("push_address").getString(), "ADM_ID");
        assertEquals(payload.toJsonValue().getMap().get("channel").getMap().get("locale_language").getString(),  Locale.getDefault().getLanguage());
        assertEquals(payload.toJsonValue().getMap().get("channel").getMap().get("locale_country").getString(), Locale.getDefault().getCountry());
    }
@ Test public void testGetNextChannelRegistrationPayloadAmazon ( ) throws JSONException { TestApplication . getApplication ( ) . setPlatform ( UAirship . AMAZON_PLATFORM ) ; pushManager . setChannel ( fakeChannelId , fakeChannelLocation ) ; pushManager . setRegistrationToken ( "ADM_ID" ) ; pushManager . setPushTokenRegistrationEnabled ( true ) ; ChannelRegistrationPayload payload = pushManager . getNextChannelRegistrationPayload ( ) ; assertNotNull ( "The payload should not be null." , payload ) ; assertEquals ( payload . toJsonValue ( ) . getMap ( ) . get ( "channel" ) . getMap ( ) . get ( "device_type" ) . getString ( ) , "amazon" ) ; assertEquals ( payload . toJsonValue ( ) . getMap ( ) . get ( "channel" ) . getMap ( ) . get ( "push_address" ) . getString ( ) , "ADM_ID" ) ; assertEquals ( payload . toJsonValue ( ) . getMap ( ) . get ( "channel" ) . getMap ( ) . get ( "locale_language" ) . getString ( ) , Locale . getDefault ( ) . getLanguage ( ) ) ; assertEquals ( payload . toJsonValue ( ) . getMap ( ) . get ( "channel" ) . getMap ( ) . get ( "locale_country" ) . getString ( ) , Locale . getDefault ( ) . getCountry ( ) ) ; }
Test getNextChannelRegistrationPayload returns a payload amazon device and ADM ID
Test getNextChannelRegistrationPayload returns a payload amazon device and ADM ID