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

        // Initialize the ADM ID token
        preferenceDataStore.put(PushManager.REGISTRATION_TOKEN_MIGRATED_KEY, false);
        preferenceDataStore.put(PushManager.ADM_REGISTRATION_ID_KEY, "admIdToken");

        // Verify that registration token has not been set
        assertNull(preferenceDataStore.getString(PushManager.REGISTRATION_TOKEN_KEY, null));

        // Migrate the ADM ID token
        pushManager.migrateRegistrationTokenSettings();

        // Verify that the token has been migrated to the new setting
        assertEquals("admIdToken", preferenceDataStore.getString(PushManager.REGISTRATION_TOKEN_KEY, null));
        assertTrue(preferenceDataStore.getBoolean(PushManager.REGISTRATION_TOKEN_MIGRATED_KEY, false));
    }
/**
     * Test migrating the ADM registration ID setting to the registration token setting.
     */
Test migrating the ADM registration ID setting to the registration token setting.
Test migrating the ADM registration ID setting to the registration token setting .
@Test
    public void testMigrateAdmRegistrationTokenSettings() {
        TestApplication.getApplication().setPlatform(UAirship.AMAZON_PLATFORM);
        preferenceDataStore.put(PushManager.REGISTRATION_TOKEN_MIGRATED_KEY, false);
        preferenceDataStore.put(PushManager.ADM_REGISTRATION_ID_KEY, "admIdToken");
        assertNull(preferenceDataStore.getString(PushManager.REGISTRATION_TOKEN_KEY, null));
        pushManager.migrateRegistrationTokenSettings();
        assertEquals("admIdToken", preferenceDataStore.getString(PushManager.REGISTRATION_TOKEN_KEY, null));
        assertTrue(preferenceDataStore.getBoolean(PushManager.REGISTRATION_TOKEN_MIGRATED_KEY, false));
    }
@ Test public void testMigrateAdmRegistrationTokenSettings ( ) { TestApplication . getApplication ( ) . setPlatform ( UAirship . AMAZON_PLATFORM ) ; preferenceDataStore . put ( PushManager . REGISTRATION_TOKEN_MIGRATED_KEY , false ) ; preferenceDataStore . put ( PushManager . ADM_REGISTRATION_ID_KEY , "admIdToken" ) ; assertNull ( preferenceDataStore . getString ( PushManager . REGISTRATION_TOKEN_KEY , null ) ) ; pushManager . migrateRegistrationTokenSettings ( ) ; assertEquals ( "admIdToken" , preferenceDataStore . getString ( PushManager . REGISTRATION_TOKEN_KEY , null ) ) ; assertTrue ( preferenceDataStore . getBoolean ( PushManager . REGISTRATION_TOKEN_MIGRATED_KEY , false ) ) ; }
Test migrating the ADM registration ID setting to the registration token setting.
Test migrating the ADM registration ID setting to the registration token setting .
// Initialize the ADM ID token // Verify that registration token has not been set // Migrate the ADM ID token // Verify that the token has been migrated to the new setting