From 18365a7b57fd7f89ad016f69a8b352ce60c4be8a Mon Sep 17 00:00:00 2001 From: Jonathan Edey Date: Tue, 17 Sep 2024 13:29:01 -0400 Subject: [PATCH] Fix testConnectTimeoutGet test --- .../google/firebase/internal/ApacheHttp2TransportIT.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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());