Skip to content

Commit 977ea6f

Browse files
committed
Fix test
1 parent b0860e2 commit 977ea6f

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

firebase-config/src/test/java/com/google/firebase/remoteconfig/FirebaseRemoteConfigTest.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,14 +1134,7 @@ public void realtime_stream_listen_and_retry_success() throws Exception {
11341134

11351135
@Test
11361136
public void realtime_stream_listen_fail() throws Exception {
1137-
when(mockHttpURLConnection.getResponseCode()).thenReturn(400);
1138-
when(mockHttpURLConnection.getInputStream())
1139-
.thenReturn(
1140-
new ByteArrayInputStream(
1141-
"{\\r\\n \\\"latestTemplateVersionNumber\\\": 1\\r\\n}"
1142-
.getBytes(StandardCharsets.UTF_8)));
1143-
when(mockFetchHandler.getTemplateVersionNumber()).thenReturn(1L);
1144-
when(mockFetchHandler.fetch(0)).thenReturn(Tasks.forResult(realtimeFetchedContainerResponse));
1137+
when(mockHttpURLConnection.getInputStream()).thenThrow(IOException.class);
11451138
configAutoFetch.listenForNotifications();
11461139

11471140
verify(mockListener).onError(any(FirebaseRemoteConfigRealtimeUpdateFetchException.class));

0 commit comments

Comments
 (0)