@Test public void fetchAndActivate_getActivatedFailed_activatesAndClearsFetched() { loadFetchHandlerWithResponse(); loadCacheWithConfig(mockFetchedCache, firstFetchedContainer); loadCacheWithIoException(mockActivatedCache); cachePutReturnsConfig(mockActivatedCache, firstFetchedContainer); Task<Boolean> task = frc.fetchAndActivate(); assertWithMessage("fetchAndActivate() failed with no activated values!") .that(getTaskResult(task)) .isTrue(); verify(mockActivatedCache).put(firstFetchedContainer); verify(mockFetchedCache).clear(); }
@NonNull public Task<Boolean> fetchAndActivate() { return fetch().onSuccessTask(executor, (unusedVoid) -> activate()); }
FirebaseRemoteConfig { @NonNull public Task<Boolean> fetchAndActivate() { return fetch().onSuccessTask(executor, (unusedVoid) -> activate()); } }
FirebaseRemoteConfig { @NonNull public Task<Boolean> fetchAndActivate() { return fetch().onSuccessTask(executor, (unusedVoid) -> activate()); } FirebaseRemoteConfig(
      Context context,
      FirebaseApp firebaseApp,
      FirebaseInstallationsApi firebaseInstallations,
      @Nullable FirebaseABTesting firebaseAbt,
      Executor executor,
      ConfigCacheClient fetchedConfigsCache,
      ConfigCacheClient activatedConfigsCache,
      ConfigCacheClient defaultConfigsCache,
      ConfigFetchHandler fetchHandler,
      ConfigGetParameterHandler getHandler,
      ConfigMetadataClient frcMetadata); }
FirebaseRemoteConfig { @NonNull public Task<Boolean> fetchAndActivate() { return fetch().onSuccessTask(executor, (unusedVoid) -> activate()); } FirebaseRemoteConfig(
      Context context,
      FirebaseApp firebaseApp,
      FirebaseInstallationsApi firebaseInstallations,
      @Nullable FirebaseABTesting firebaseAbt,
      Executor executor,
      ConfigCacheClient fetchedConfigsCache,
      ConfigCacheClient activatedConfigsCache,
      ConfigCacheClient defaultConfigsCache,
      ConfigFetchHandler fetchHandler,
      ConfigGetParameterHandler getHandler,
      ConfigMetadataClient frcMetadata); @NonNull static FirebaseRemoteConfig getInstance(); @NonNull static FirebaseRemoteConfig getInstance(@NonNull FirebaseApp app); @NonNull Task<FirebaseRemoteConfigInfo> ensureInitialized(); @NonNull Task<Boolean> fetchAndActivate(); @Deprecated @WorkerThread boolean activateFetched(); @NonNull Task<Boolean> activate(); @NonNull Task<Void> fetch(); @NonNull Task<Void> fetch(long minimumFetchIntervalInSeconds); @NonNull String getString(@NonNull String key); boolean getBoolean(@NonNull String key); @NonNull @Deprecated byte[] getByteArray(@NonNull String key); double getDouble(@NonNull String key); long getLong(@NonNull String key); @NonNull FirebaseRemoteConfigValue getValue(@NonNull String key); @NonNull Set<String> getKeysByPrefix(@NonNull String prefix); @NonNull Map<String, FirebaseRemoteConfigValue> getAll(); @NonNull FirebaseRemoteConfigInfo getInfo(); @Deprecated void setConfigSettings(@NonNull FirebaseRemoteConfigSettings settings); @NonNull Task<Void> setConfigSettingsAsync(@NonNull FirebaseRemoteConfigSettings settings); @Deprecated void setDefaults(@NonNull Map<String, Object> defaults); @NonNull Task<Void> setDefaultsAsync(@NonNull Map<String, Object> defaults); @Deprecated void setDefaults(@XmlRes int resourceId); @NonNull Task<Void> setDefaultsAsync(@XmlRes int resourceId); @NonNull Task<Void> reset(); }
FirebaseRemoteConfig { @NonNull public Task<Boolean> fetchAndActivate() { return fetch().onSuccessTask(executor, (unusedVoid) -> activate()); } FirebaseRemoteConfig(
      Context context,
      FirebaseApp firebaseApp,
      FirebaseInstallationsApi firebaseInstallations,
      @Nullable FirebaseABTesting firebaseAbt,
      Executor executor,
      ConfigCacheClient fetchedConfigsCache,
      ConfigCacheClient activatedConfigsCache,
      ConfigCacheClient defaultConfigsCache,
      ConfigFetchHandler fetchHandler,
      ConfigGetParameterHandler getHandler,
      ConfigMetadataClient frcMetadata); @NonNull static FirebaseRemoteConfig getInstance(); @NonNull static FirebaseRemoteConfig getInstance(@NonNull FirebaseApp app); @NonNull Task<FirebaseRemoteConfigInfo> ensureInitialized(); @NonNull Task<Boolean> fetchAndActivate(); @Deprecated @WorkerThread boolean activateFetched(); @NonNull Task<Boolean> activate(); @NonNull Task<Void> fetch(); @NonNull Task<Void> fetch(long minimumFetchIntervalInSeconds); @NonNull String getString(@NonNull String key); boolean getBoolean(@NonNull String key); @NonNull @Deprecated byte[] getByteArray(@NonNull String key); double getDouble(@NonNull String key); long getLong(@NonNull String key); @NonNull FirebaseRemoteConfigValue getValue(@NonNull String key); @NonNull Set<String> getKeysByPrefix(@NonNull String prefix); @NonNull Map<String, FirebaseRemoteConfigValue> getAll(); @NonNull FirebaseRemoteConfigInfo getInfo(); @Deprecated void setConfigSettings(@NonNull FirebaseRemoteConfigSettings settings); @NonNull Task<Void> setConfigSettingsAsync(@NonNull FirebaseRemoteConfigSettings settings); @Deprecated void setDefaults(@NonNull Map<String, Object> defaults); @NonNull Task<Void> setDefaultsAsync(@NonNull Map<String, Object> defaults); @Deprecated void setDefaults(@XmlRes int resourceId); @NonNull Task<Void> setDefaultsAsync(@XmlRes int resourceId); @NonNull Task<Void> reset(); static final String DEFAULT_VALUE_FOR_STRING; static final long DEFAULT_VALUE_FOR_LONG; static final double DEFAULT_VALUE_FOR_DOUBLE; static final boolean DEFAULT_VALUE_FOR_BOOLEAN; static final byte[] DEFAULT_VALUE_FOR_BYTE_ARRAY; static final int VALUE_SOURCE_STATIC; static final int VALUE_SOURCE_DEFAULT; static final int VALUE_SOURCE_REMOTE; static final int LAST_FETCH_STATUS_SUCCESS; static final int LAST_FETCH_STATUS_NO_FETCH_YET; static final int LAST_FETCH_STATUS_FAILURE; static final int LAST_FETCH_STATUS_THROTTLED; static final String TAG; }