|
65 | 65 | import com.google.firebase.remoteconfig.internal.ConfigGetParameterHandler;
|
66 | 66 | import com.google.firebase.remoteconfig.internal.ConfigMetadataClient;
|
67 | 67 | import com.google.firebase.remoteconfig.internal.ConfigRealtimeHandler;
|
| 68 | +import com.google.firebase.remoteconfig.internal.ConfigRealtimeHttpClient; |
68 | 69 | import com.google.firebase.remoteconfig.internal.Personalization;
|
69 | 70 | import java.io.ByteArrayInputStream;
|
70 | 71 | import java.io.IOException;
|
@@ -140,6 +141,7 @@ public final class FirebaseRemoteConfigTest {
|
140 | 141 | @Mock private ConfigMetadataClient metadataClient;
|
141 | 142 |
|
142 | 143 | @Mock private ConfigRealtimeHandler mockConfigRealtimeHandler;
|
| 144 | + @Mock private ConfigRealtimeHttpClient mockConfigRealtimeHttpClient; |
143 | 145 | @Mock private ConfigUpdateListenerRegistration mockRealtimeRegistration;
|
144 | 146 | @Mock private HttpURLConnection mockHttpURLConnection;
|
145 | 147 | @Mock private ConfigUpdateListener mockListener;
|
@@ -1203,6 +1205,14 @@ public void realtime_stream_autofetch_failure() {
|
1203 | 1205 | verify(mockListener).onError(any(FirebaseRemoteConfigRealtimeUpdateFetchException.class));
|
1204 | 1206 | }
|
1205 | 1207 |
|
| 1208 | + @Test |
| 1209 | + public void realtime_checkStatusCode_beforeRetryStream() throws Exception { |
| 1210 | + when(mockConfigRealtimeHttpClient.createRealtimeConnection()).thenReturn(mockHttpURLConnection); |
| 1211 | + when(mockHttpURLConnection.getResponseCode()).thenReturn(502); |
| 1212 | + mockConfigRealtimeHttpClient.beginRealtimeHttpStream(); |
| 1213 | + verify(mockConfigRealtimeHttpClient, never()).retryHTTPConnection(); |
| 1214 | + } |
| 1215 | + |
1206 | 1216 | private static void loadCacheWithConfig(
|
1207 | 1217 | ConfigCacheClient cacheClient, ConfigContainer container) {
|
1208 | 1218 | when(cacheClient.getBlocking()).thenReturn(container);
|
|
0 commit comments