@Test public void shouldMigrateAdminSettings() { prefs = AdminSharedPreferences.getInstance().getSharedPreferences(); initPrefs("unrelated", "value"); PrefMigrator.migrateSharedPrefs(); assertPrefs("unrelated", "value"); initPrefs("show_map_sdk", true); PrefMigrator.migrateSharedPrefs(); assertPrefs("show_map_sdk", true); initPrefs("show_map_sdk", false); PrefMigrator.migrateSharedPrefs(); assertPrefs("maps", false); initPrefs("show_map_basemap", true); PrefMigrator.migrateSharedPrefs(); assertPrefs("show_map_basemap", true); initPrefs("show_map_basemap", false); PrefMigrator.migrateSharedPrefs(); assertPrefs("maps", false); }
public static void migrateSharedPrefs() { migrate(PrefUtils.getSharedPrefs(), MIGRATIONS); migrate(PrefUtils.getAdminSharedPrefs(), ADMIN_MIGRATIONS); }
PrefMigrator { public static void migrateSharedPrefs() { migrate(PrefUtils.getSharedPrefs(), MIGRATIONS); migrate(PrefUtils.getAdminSharedPrefs(), ADMIN_MIGRATIONS); } }
PrefMigrator { public static void migrateSharedPrefs() { migrate(PrefUtils.getSharedPrefs(), MIGRATIONS); migrate(PrefUtils.getAdminSharedPrefs(), ADMIN_MIGRATIONS); } private  PrefMigrator(); }
PrefMigrator { public static void migrateSharedPrefs() { migrate(PrefUtils.getSharedPrefs(), MIGRATIONS); migrate(PrefUtils.getAdminSharedPrefs(), ADMIN_MIGRATIONS); } private  PrefMigrator(); static void migrate(SharedPreferences prefs, Migration... migrations); static void migrateSharedPrefs(); }
PrefMigrator { public static void migrateSharedPrefs() { migrate(PrefUtils.getSharedPrefs(), MIGRATIONS); migrate(PrefUtils.getAdminSharedPrefs(), ADMIN_MIGRATIONS); } private  PrefMigrator(); static void migrate(SharedPreferences prefs, Migration... migrations); static void migrateSharedPrefs();  }