diff --git a/src/test/java/com/google/firebase/internal/ApacheHttp2TransportIT.java b/src/test/java/com/google/firebase/internal/ApacheHttp2TransportIT.java index 340cd973..224eeabe 100644 --- a/src/test/java/com/google/firebase/internal/ApacheHttp2TransportIT.java +++ b/src/test/java/com/google/firebase/internal/ApacheHttp2TransportIT.java @@ -117,10 +117,11 @@ public void testUnauthorizedPostRequest() throws FirebaseException { @Test(timeout = 10_000L) public void testConnectTimeoutGet() throws IOException { - HttpTransport transport = new ApacheHttp2Transport(); + ApacheHttp2Transport transport = new ApacheHttp2Transport(); + ApacheHttp2Request request = transport.buildRequest("GET", "https://localhost:" + port); + request.setTimeout(100, 0); try { - transport.createRequestFactory().buildGetRequest(new GenericUrl("https://localhost:" + port)) - .setConnectTimeout(100).execute(); + request.execute(); fail("No exception thrown for HTTP error response"); } catch (IOException e) { System.out.println(e.getCause());