Skip to content

Commit 18365a7

Browse files
committed
Fix testConnectTimeoutGet test
1 parent ceac56c commit 18365a7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/test/java/com/google/firebase/internal/ApacheHttp2TransportIT.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,11 @@ public void testUnauthorizedPostRequest() throws FirebaseException {
117117

118118
@Test(timeout = 10_000L)
119119
public void testConnectTimeoutGet() throws IOException {
120-
HttpTransport transport = new ApacheHttp2Transport();
120+
ApacheHttp2Transport transport = new ApacheHttp2Transport();
121+
ApacheHttp2Request request = transport.buildRequest("GET", "https://localhost:" + port);
122+
request.setTimeout(100, 0);
121123
try {
122-
transport.createRequestFactory().buildGetRequest(new GenericUrl("https://localhost:" + port))
123-
.setConnectTimeout(100).execute();
124+
request.execute();
124125
fail("No exception thrown for HTTP error response");
125126
} catch (IOException e) {
126127
System.out.println(e.getCause());

0 commit comments

Comments
 (0)