@Test public void testClearCustomInstallationId_CacheError_BackendOk() throws InterruptedException { FirebaseSegmentation firebaseSegmentation = new FirebaseSegmentation( firebaseApp, firebaseInstallationsApi, cacheReturnsError, backendClientReturnsOk); try { TestOnCompleteListener<Void> onCompleteListener = new TestOnCompleteListener<>(); firebaseSegmentation .setCustomInstallationId(null) .addOnCompleteListener(taskExecutor, onCompleteListener); onCompleteListener.await(); fail(); } catch (ExecutionException expected) { Throwable cause = expected.getCause(); assertThat(cause).isInstanceOf(SetCustomInstallationIdException.class); assertThat(((SetCustomInstallationIdException) cause).getStatus()) .isEqualTo(SetCustomInstallationIdException.Status.CLIENT_ERROR); } }
@NonNull public synchronized Task<Void> setCustomInstallationId(@Nullable String customInstallationId) { if (customInstallationId == null) { return Tasks.call(executor, () -> clearCustomInstallationId()); } return Tasks.call(executor, () -> updateCustomInstallationId(customInstallationId)); }
FirebaseSegmentation { @NonNull public synchronized Task<Void> setCustomInstallationId(@Nullable String customInstallationId) { if (customInstallationId == null) { return Tasks.call(executor, () -> clearCustomInstallationId()); } return Tasks.call(executor, () -> updateCustomInstallationId(customInstallationId)); } }
FirebaseSegmentation { @NonNull public synchronized Task<Void> setCustomInstallationId(@Nullable String customInstallationId) { if (customInstallationId == null) { return Tasks.call(executor, () -> clearCustomInstallationId()); } return Tasks.call(executor, () -> updateCustomInstallationId(customInstallationId)); } FirebaseSegmentation(FirebaseApp firebaseApp, FirebaseInstallationsApi firebaseInstallationsApi);   FirebaseSegmentation(
      FirebaseApp firebaseApp,
      FirebaseInstallationsApi firebaseInstallationsApi,
      CustomInstallationIdCache localCache,
      SegmentationServiceClient backendServiceClient); }
FirebaseSegmentation { @NonNull public synchronized Task<Void> setCustomInstallationId(@Nullable String customInstallationId) { if (customInstallationId == null) { return Tasks.call(executor, () -> clearCustomInstallationId()); } return Tasks.call(executor, () -> updateCustomInstallationId(customInstallationId)); } FirebaseSegmentation(FirebaseApp firebaseApp, FirebaseInstallationsApi firebaseInstallationsApi);   FirebaseSegmentation(
      FirebaseApp firebaseApp,
      FirebaseInstallationsApi firebaseInstallationsApi,
      CustomInstallationIdCache localCache,
      SegmentationServiceClient backendServiceClient); @NonNull static FirebaseSegmentation getInstance(); @NonNull static FirebaseSegmentation getInstance(@NonNull FirebaseApp app); @NonNull synchronized Task<Void> setCustomInstallationId(@Nullable String customInstallationId); }
FirebaseSegmentation { @NonNull public synchronized Task<Void> setCustomInstallationId(@Nullable String customInstallationId) { if (customInstallationId == null) { return Tasks.call(executor, () -> clearCustomInstallationId()); } return Tasks.call(executor, () -> updateCustomInstallationId(customInstallationId)); } FirebaseSegmentation(FirebaseApp firebaseApp, FirebaseInstallationsApi firebaseInstallationsApi);   FirebaseSegmentation(
      FirebaseApp firebaseApp,
      FirebaseInstallationsApi firebaseInstallationsApi,
      CustomInstallationIdCache localCache,
      SegmentationServiceClient backendServiceClient); @NonNull static FirebaseSegmentation getInstance(); @NonNull static FirebaseSegmentation getInstance(@NonNull FirebaseApp app); @NonNull synchronized Task<Void> setCustomInstallationId(@Nullable String customInstallationId); static final String TAG; }