File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
firebase-config/src/test/java/com/google/firebase/remoteconfig Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -1107,7 +1107,6 @@ public void realtime_client_removeListener_success() {
1107
1107
1108
1108
@ Test
1109
1109
public void realtime_stream_listen_and_retry_success () throws Exception {
1110
- when (mockHttpURLConnection .getResponseCode ()).thenReturn (200 );
1111
1110
when (mockHttpURLConnection .getInputStream ())
1112
1111
.thenReturn (
1113
1112
new ByteArrayInputStream (
@@ -1121,17 +1120,10 @@ public void realtime_stream_listen_and_retry_success() throws Exception {
1121
1120
1122
1121
@ Test
1123
1122
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 );
1132
1124
configAutoFetch .listenForNotifications ();
1133
1125
1134
- verify (mockListener ).onError (any (FirebaseRemoteConfigRealtimeUpdateStreamException .class ));
1126
+ verify (mockListener ).onError (any (FirebaseRemoteConfigRealtimeUpdateFetchException .class ));
1135
1127
}
1136
1128
1137
1129
@ Test
You can’t perform that action at this time.
0 commit comments