5050@ TestInstance (PER_CLASS )
5151final class TestProxyRequestHandler
5252{
53+ private static final String OK = "OK" ;
54+ private static final int NOT_FOUND = 404 ;
55+ private static final MediaType MEDIA_TYPE = MediaType .parse ("application/json; charset=utf-8" );
56+
5357 private final OkHttpClient httpClient = new OkHttpClient ();
5458 private final MockWebServer mockTrinoServer = new MockWebServer ();
5559 private final PostgreSQLContainer postgresql = new PostgreSQLContainer ("postgres:17" );
56-
5760 private final int routerPort = 21001 + (int ) (Math .random () * 1000 );
5861 private final int customBackendPort = 21000 + (int ) (Math .random () * 1000 );
59-
60- private static final String OK = "OK" ;
61- private static final int NOT_FOUND = 404 ;
62- private static final MediaType MEDIA_TYPE = MediaType .parse ("application/json; charset=utf-8" );
63-
6462 private final String customPutEndpoint = "/v1/custom" ; // this is enabled in test-config-template.yml
6563 private final String healthCheckEndpoint = "/v1/info" ;
6664
@@ -69,7 +67,8 @@ void setup()
6967 throws Exception
7068 {
7169 prepareMockBackend (mockTrinoServer , customBackendPort , "default custom response" );
72- mockTrinoServer .setDispatcher (new Dispatcher () {
70+ mockTrinoServer .setDispatcher (new Dispatcher ()
71+ {
7372 @ Override
7473 public MockResponse dispatch (RecordedRequest request )
7574 {
@@ -130,18 +129,18 @@ void testGetQueryDetailsFromRequest()
130129 {
131130 // A sample query longer than 200 characters to test against truncation.
132131 String longQuery = """
133- SELECT
134- c.customer_name,
135- c.customer_region,
136- COUNT(o.order_id) AS total_orders,
137- SUM(o.order_value) AS total_revenue
138- FROM
139- hive.sales_data.customers AS c
140- JOIN
141- hive.sales_data.orders AS o
142- ON c.customer_id = o.customer_id
143- WHERE
144- o.order_date >= date '2023-01-01'""" ;
132+ SELECT
133+ c.customer_name,
134+ c.customer_region,
135+ COUNT(o.order_id) AS total_orders,
136+ SUM(o.order_value) AS total_revenue
137+ FROM
138+ hive.sales_data.customers AS c
139+ JOIN
140+ hive.sales_data.orders AS o
141+ ON c.customer_id = o.customer_id
142+ WHERE
143+ o.order_date >= date '2023-01-01'""" ;
145144
146145 io .airlift .http .client .Request request = preparePost ()
147146 .setUri (URI .create ("http://localhost:" + routerPort + V1_STATEMENT_PATH ))
0 commit comments