diff --git a/gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java b/gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java index 7f7e5f0da..f17334456 100644 --- a/gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java +++ b/gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java @@ -166,21 +166,21 @@ public void testTrinoClusterHostCookie() RequestBody requestBody = RequestBody.create("SELECT 1", MediaType.get("application/json; charset=utf-8")); // When X-Trino-Routing-Group is set in header, query should be routed to cluster under the routing group - Request requestOne = + Request requestWithoutCookie = new Request.Builder() .url("http://localhost:" + routerPort + "/v1/statement") .addHeader("X-Trino-User", "test") .post(requestBody) .addHeader("X-Trino-Routing-Group", "scheduled") .build(); - Response responseOne = httpClient.newCall(requestOne).execute(); + Response responseOne = httpClient.newCall(requestWithoutCookie).execute(); assertThat(responseOne.body().string()).contains("http://localhost:" + routerPort); List cookies = Cookie.parseAll(responseOne.request().url(), responseOne.headers()); Cookie cookie = cookies.stream().filter(c -> c.name().equals("trinoClusterHost")).collect(onlyElement()); assertThat(cookie.value()).isEqualTo("localhost"); // test with sending the request which includes trinoClusterHost in the cookie // when X-Trino-Routing-Group is set in header, query should be routed to cluster under the routing group - Request requestTwo = + Request requestWithCookie = new Request.Builder() .url("http://localhost:" + routerPort + "/v1/statement") .addHeader("X-Trino-User", "test") @@ -188,7 +188,7 @@ public void testTrinoClusterHostCookie() .addHeader("X-Trino-Routing-Group", "scheduled") .addHeader("Cookie", "trinoClientHost=foo.example.com") .build(); - Response responseTwo = httpClient.newCall(requestTwo).execute(); + Response responseTwo = httpClient.newCall(requestWithCookie).execute(); assertThat(responseTwo.body().string()).contains("http://localhost:" + routerPort); cookies = Cookie.parseAll(responseTwo.request().url(), responseTwo.headers()); cookie = cookies.stream().filter(c -> c.name().equals("trinoClusterHost")).collect(onlyElement());