Skip to content

Commit 0092415

Browse files
committed
Fix tests.
1 parent 91248fd commit 0092415

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,6 @@ public void realtime_client_removeListener_success() {
11071107

11081108
@Test
11091109
public void realtime_stream_listen_and_retry_success() throws Exception {
1110-
when(mockHttpURLConnection.getResponseCode()).thenReturn(200);
11111110
when(mockHttpURLConnection.getInputStream())
11121111
.thenReturn(
11131112
new ByteArrayInputStream(
@@ -1121,17 +1120,10 @@ public void realtime_stream_listen_and_retry_success() throws Exception {
11211120

11221121
@Test
11231122
public void realtime_stream_listen_fail() throws Exception {
1124-
when(mockHttpURLConnection.getResponseCode()).thenReturn(400);
1125-
when(mockHttpURLConnection.getInputStream())
1126-
.thenReturn(
1127-
new ByteArrayInputStream(
1128-
"{\\r\\n \\\"latestTemplateVersionNumber\\\": 1\\r\\n}"
1129-
.getBytes(StandardCharsets.UTF_8)));
1130-
when(mockFetchHandler.getTemplateVersionNumber()).thenReturn(1L);
1131-
when(mockFetchHandler.fetch(0)).thenReturn(Tasks.forResult(realtimeFetchedContainerResponse));
1123+
when(mockHttpURLConnection.getInputStream()).thenThrow(IOException.class);
11321124
configAutoFetch.listenForNotifications();
11331125

1134-
verify(mockListener).onError(any(FirebaseRemoteConfigRealtimeUpdateStreamException.class));
1126+
verify(mockListener).onError(any(FirebaseRemoteConfigRealtimeUpdateFetchException.class));
11351127
}
11361128

11371129
@Test

0 commit comments

Comments
 (0)