@@ -60,7 +60,7 @@ public class ApacheHttp2TransportIT {
60
60
61
61
// Sets a 5 second delay before response
62
62
private static final String DELAY_URL = "https://nghttp2.org/httpbin/delay/5" ;
63
- private static final String NO_CONNECT_URL = "https ://google.com:81" ;
63
+ private static final String NO_CONNECT_URL = "http ://google.com:81" ;
64
64
private static final String GET_URL = "https://nghttp2.org/httpbin/get" ;
65
65
private static final String POST_URL = "https://nghttp2.org/httpbin/post" ;
66
66
@@ -124,19 +124,15 @@ public void testConnectTimeoutPost() throws IOException {
124
124
public void testConnectTimeoutAuthorizedGet () throws FirebaseException {
125
125
app = FirebaseApp .initializeApp (FirebaseOptions .builder ()
126
126
.setCredentials (MOCK_CREDENTIALS )
127
- // .setConnectTimeout(100)
127
+ .setConnectTimeout (100 )
128
128
.build (), "test-app" );
129
129
ErrorHandlingHttpClient <FirebaseException > httpClient = getHttpClient (true , app );
130
- HttpRequestInfo request = HttpRequestInfo .buildGetRequest (GET_URL );
130
+ HttpRequestInfo request = HttpRequestInfo .buildGetRequest (NO_CONNECT_URL );
131
131
132
132
try {
133
133
httpClient .send (request );
134
134
fail ("No exception thrown for HTTP error response" );
135
135
} catch (FirebaseException e ) {
136
- System .out .println (e .getCause ());
137
- System .out .println (e .getCause ().getMessage ());
138
- System .out .println (e .getCause ().getCause ());
139
- System .out .println (e .getCause ().getCause ().getMessage ());
140
136
assertEquals (ErrorCode .UNKNOWN , e .getErrorCode ());
141
137
assertEquals ("IO error: Connection Timeout" , e .getMessage ());
142
138
assertNull (e .getHttpResponse ());
@@ -150,18 +146,14 @@ public void testConnectTimeoutAuthorizedPost() throws FirebaseException {
150
146
.setConnectTimeout (100 )
151
147
.build (), "test-app" );
152
148
ErrorHandlingHttpClient <FirebaseException > httpClient = getHttpClient (true , app );
153
- HttpRequestInfo request = HttpRequestInfo .buildJsonPostRequest (POST_URL , payload );
149
+ HttpRequestInfo request = HttpRequestInfo .buildJsonPostRequest (NO_CONNECT_URL , payload );
154
150
155
151
try {
156
152
httpClient .send (request );
157
153
fail ("No exception thrown for HTTP error response" );
158
154
} catch (FirebaseException e ) {
159
- System .out .println (e .getCause ());
160
- System .out .println (e .getCause ().getMessage ());
161
- System .out .println (e .getCause ().getCause ());
162
- System .out .println (e .getCause ().getCause ().getMessage ());
163
155
assertEquals (ErrorCode .UNKNOWN , e .getErrorCode ());
164
- assertEquals ("IO error: Exception in request " , e .getMessage ());
156
+ assertEquals ("IO error: Connection Timeout " , e .getMessage ());
165
157
assertNull (e .getHttpResponse ());
166
158
}
167
159
}
0 commit comments