@Test
  public void testOnboardingCompletedForUpgradingUser() {
    accountDb.add("johndoeTotp@gmail.com", "7777777777777777", OtpType.TOTP, null, null, null);
    Context context = InstrumentationRegistry.getInstrumentation().getTargetContext();
    setOnboardingCompletedPreference(context, false);
    AuthenticatorActivity activity = activityTestRule.launchActivity(null);
    assertThat(activity.onboardingCompleted).isTrue();
  }
Unit tests for {@link AuthenticatorActivity} (part/shard 1).
javatests/com/google/android/apps/authenticator/AuthenticatorActivityTest.java