@Test public void testGetAuthToken_fidDoesNotExist_successful() throws Exception { when(mockBackend.createFirebaseInstallation( anyString(), anyString(), anyString(), anyString(), any())) .thenReturn(TEST_INSTALLATION_RESPONSE); TestOnCompleteListener<InstallationTokenResult> onCompleteListener = new TestOnCompleteListener<>(); Task<InstallationTokenResult> task = firebaseInstallations.getToken(false); task.addOnCompleteListener(executor, onCompleteListener); onCompleteListener.await(); PersistedInstallationEntry entry = persistedInstallation.readPersistedInstallationEntryValue(); assertThat(entry.getAuthToken(), equalTo(TEST_AUTH_TOKEN)); }
@NonNull @Override public Task<InstallationTokenResult> getToken(boolean forceRefresh) { preConditionChecks(); Task<InstallationTokenResult> task = addGetAuthTokenListener(); backgroundExecutor.execute(() -> doRegistrationOrRefresh(forceRefresh)); return task; }
FirebaseInstallations implements FirebaseInstallationsApi { @NonNull @Override public Task<InstallationTokenResult> getToken(boolean forceRefresh) { preConditionChecks(); Task<InstallationTokenResult> task = addGetAuthTokenListener(); backgroundExecutor.execute(() -> doRegistrationOrRefresh(forceRefresh)); return task; } }
FirebaseInstallations implements FirebaseInstallationsApi { @NonNull @Override public Task<InstallationTokenResult> getToken(boolean forceRefresh) { preConditionChecks(); Task<InstallationTokenResult> task = addGetAuthTokenListener(); backgroundExecutor.execute(() -> doRegistrationOrRefresh(forceRefresh)); return task; } FirebaseInstallations(
      FirebaseApp firebaseApp,
      @NonNull Provider<UserAgentPublisher> publisher,
      @NonNull Provider<HeartBeatInfo> heartbeatInfo);   FirebaseInstallations(
      ExecutorService backgroundExecutor,
      FirebaseApp firebaseApp,
      FirebaseInstallationServiceClient serviceClient,
      PersistedInstallation persistedInstallation,
      Utils utils,
      IidStore iidStore,
      RandomFidGenerator fidGenerator); }
FirebaseInstallations implements FirebaseInstallationsApi { @NonNull @Override public Task<InstallationTokenResult> getToken(boolean forceRefresh) { preConditionChecks(); Task<InstallationTokenResult> task = addGetAuthTokenListener(); backgroundExecutor.execute(() -> doRegistrationOrRefresh(forceRefresh)); return task; } FirebaseInstallations(
      FirebaseApp firebaseApp,
      @NonNull Provider<UserAgentPublisher> publisher,
      @NonNull Provider<HeartBeatInfo> heartbeatInfo);   FirebaseInstallations(
      ExecutorService backgroundExecutor,
      FirebaseApp firebaseApp,
      FirebaseInstallationServiceClient serviceClient,
      PersistedInstallation persistedInstallation,
      Utils utils,
      IidStore iidStore,
      RandomFidGenerator fidGenerator); @NonNull static FirebaseInstallations getInstance(); @NonNull static FirebaseInstallations getInstance(@NonNull FirebaseApp app); @NonNull @Override Task<String> getId(); @NonNull @Override Task<InstallationTokenResult> getToken(boolean forceRefresh); @NonNull @Override Task<Void> delete(); }
FirebaseInstallations implements FirebaseInstallationsApi { @NonNull @Override public Task<InstallationTokenResult> getToken(boolean forceRefresh) { preConditionChecks(); Task<InstallationTokenResult> task = addGetAuthTokenListener(); backgroundExecutor.execute(() -> doRegistrationOrRefresh(forceRefresh)); return task; } FirebaseInstallations(
      FirebaseApp firebaseApp,
      @NonNull Provider<UserAgentPublisher> publisher,
      @NonNull Provider<HeartBeatInfo> heartbeatInfo);   FirebaseInstallations(
      ExecutorService backgroundExecutor,
      FirebaseApp firebaseApp,
      FirebaseInstallationServiceClient serviceClient,
      PersistedInstallation persistedInstallation,
      Utils utils,
      IidStore iidStore,
      RandomFidGenerator fidGenerator); @NonNull static FirebaseInstallations getInstance(); @NonNull static FirebaseInstallations getInstance(@NonNull FirebaseApp app); @NonNull @Override Task<String> getId(); @NonNull @Override Task<InstallationTokenResult> getToken(boolean forceRefresh); @NonNull @Override Task<Void> delete();  }