@Test public void fetch_getsMultipleFailedResponsesFromServer_resetsBackoffAfterSuccessfulFetch() throws Exception { callFetchAssertThrottledAndAdvanceClock(HTTP_TOO_MANY_REQUESTS); callFetchAssertThrottledAndAdvanceClock(HTTP_BAD_GATEWAY); callFetchAssertThrottledAndAdvanceClock(HTTP_UNAVAILABLE); callFetchAssertThrottledAndAdvanceClock(HTTP_GATEWAY_TIMEOUT); fetchCallToHttpClientReturnsConfigWithCurrentTime(firstFetchedContainer); Task<FetchResponse> fetchTask = fetchHandler.fetch( 0L); assertWithMessage("Fetch() failed!").that(fetchTask.isSuccessful()).isTrue(); BackoffMetadata backoffMetadata = metadataClient.getBackoffMetadata(); assertThat(backoffMetadata.getNumFailedFetches()).isEqualTo(NO_FAILED_FETCHES); assertThat(backoffMetadata.getBackoffEndTime()).isEqualTo(NO_BACKOFF_TIME); }
public Task<FetchResponse> fetch() { return fetch(frcMetadata.getMinimumFetchIntervalInSeconds()); }
ConfigFetchHandler { public Task<FetchResponse> fetch() { return fetch(frcMetadata.getMinimumFetchIntervalInSeconds()); } }
ConfigFetchHandler { public Task<FetchResponse> fetch() { return fetch(frcMetadata.getMinimumFetchIntervalInSeconds()); } ConfigFetchHandler(
      FirebaseInstallationsApi firebaseInstallations,
      @Nullable AnalyticsConnector analyticsConnector,
      Executor executor,
      Clock clock,
      Random randomGenerator,
      ConfigCacheClient fetchedConfigsCache,
      ConfigFetchHttpClient frcBackendApiClient,
      ConfigMetadataClient frcMetadata,
      Map<String, String> customHttpHeaders); }
ConfigFetchHandler { public Task<FetchResponse> fetch() { return fetch(frcMetadata.getMinimumFetchIntervalInSeconds()); } ConfigFetchHandler(
      FirebaseInstallationsApi firebaseInstallations,
      @Nullable AnalyticsConnector analyticsConnector,
      Executor executor,
      Clock clock,
      Random randomGenerator,
      ConfigCacheClient fetchedConfigsCache,
      ConfigFetchHttpClient frcBackendApiClient,
      ConfigMetadataClient frcMetadata,
      Map<String, String> customHttpHeaders); Task<FetchResponse> fetch(); Task<FetchResponse> fetch(long minimumFetchIntervalInSeconds); @VisibleForTesting @Nullable AnalyticsConnector getAnalyticsConnector(); }
ConfigFetchHandler { public Task<FetchResponse> fetch() { return fetch(frcMetadata.getMinimumFetchIntervalInSeconds()); } ConfigFetchHandler(
      FirebaseInstallationsApi firebaseInstallations,
      @Nullable AnalyticsConnector analyticsConnector,
      Executor executor,
      Clock clock,
      Random randomGenerator,
      ConfigCacheClient fetchedConfigsCache,
      ConfigFetchHttpClient frcBackendApiClient,
      ConfigMetadataClient frcMetadata,
      Map<String, String> customHttpHeaders); Task<FetchResponse> fetch(); Task<FetchResponse> fetch(long minimumFetchIntervalInSeconds); @VisibleForTesting @Nullable AnalyticsConnector getAnalyticsConnector(); static final long DEFAULT_MINIMUM_FETCH_INTERVAL_IN_SECONDS; }