ApplicationMetrics extends AirshipComponent { public boolean getAppVersionUpdated() { return appVersionUpdated; } ApplicationMetrics(@NonNull Context context, @NonNull final PreferenceDataStore preferenceDataStore, @NonNull ActivityMonitor activityMonitor); long getLastOpenTimeMillis(); boolean getAppVersionUpdated(); long getCurrentAppVersion();  }
@Test public void testGetAppVersionUpdated() { dataStore.put("com.urbanairship.application.metrics.APP_VERSION", 1L); PackageInfo info = packageManager.getInternalMutablePackageInfo(TestApplication.getApplication().getPackageName()); info.setLongVersionCode(2); metrics.init(); assertTrue(metrics.getAppVersionUpdated()); assertEquals(2L, dataStore.getLong("com.urbanairship.application.metrics.APP_VERSION", -1)); }