github-code-scanning[bot] commented on code in PR #13696:
URL: https://github.com/apache/druid/pull/13696#discussion_r1082214178


##########
integration-tests-ex/cases/src/test/java/org/apache/druid/testsEx/query/ITJdbcQueryTest.java:
##########
@@ -0,0 +1,232 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.testsEx.query;
+
+import static org.apache.druid.testsEx.utils.RegexMatchUtil.matchesRegex;
+
+import com.google.common.collect.ImmutableList;
+import com.google.inject.Inject;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import org.apache.calcite.avatica.AvaticaSqlException;
+import org.apache.druid.https.SSLClientConfig;
+import org.apache.druid.java.util.common.StringUtils;
+import org.apache.druid.java.util.common.logger.Logger;
+import org.apache.druid.testing.IntegrationTestingConfig;
+import org.apache.druid.testing.utils.DataLoaderHelper;
+import org.apache.druid.testsEx.categories.Query;
+import org.apache.druid.testsEx.config.DruidTestRunner;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+
+@RunWith(DruidTestRunner.class)
+@Category(Query.class)
+public class ITJdbcQueryTest
+{
+  private static final Logger LOG = new Logger(ITJdbcQueryTest.class);
+  private static final String WIKIPEDIA_DATA_SOURCE = "wikipedia_editstream";
+  private static final String CONNECTION_TEMPLATE = 
"jdbc:avatica:remote:url=%s/druid/v2/sql/avatica/";
+  private static final String TLS_CONNECTION_TEMPLATE =
+      
"jdbc:avatica:remote:url=%s/druid/v2/sql/avatica/;truststore=%s;truststore_password=%s;keystore=%s;keystore_password=%s;key_password=%s";
+
+  private static final String QUERY_TEMPLATE =
+      "SELECT \"user\", SUM(\"added\"), COUNT(*)" +
+      "FROM \"wikipedia\" " +
+      "WHERE \"__time\" >= CURRENT_TIMESTAMP - INTERVAL '10' YEAR AND 
\"language\" = %s" +
+      "GROUP BY 1 ORDER BY 3 DESC LIMIT 10";
+  private static final String QUERY = StringUtils.format(QUERY_TEMPLATE, 
"'en'");
+
+  private static final String QUERY_PARAMETERIZED = 
StringUtils.format(QUERY_TEMPLATE, "?");
+
+  private String[] connections;
+  private Properties connectionProperties;
+
+  @Inject
+  private IntegrationTestingConfig config;
+
+  @Inject
+  SSLClientConfig sslConfig;
+
+  @Inject
+  private DataLoaderHelper dataLoaderHelper;
+
+  @Before
+  public void before()
+  {
+    connectionProperties = new Properties();
+    connectionProperties.setProperty("user", "admin");
+    connectionProperties.setProperty("password", "priest");
+    connections = new String[]{
+        StringUtils.format(CONNECTION_TEMPLATE, config.getRouterUrl()),
+        StringUtils.format(CONNECTION_TEMPLATE, config.getBrokerUrl()),
+        StringUtils.format(
+            TLS_CONNECTION_TEMPLATE,
+            config.getRouterTLSUrl(),
+            sslConfig.getTrustStorePath(),
+            sslConfig.getTrustStorePasswordProvider().getPassword(),
+            sslConfig.getKeyStorePath(),
+            sslConfig.getKeyStorePasswordProvider().getPassword(),
+            sslConfig.getKeyManagerPasswordProvider().getPassword()
+        ),
+        StringUtils.format(
+            TLS_CONNECTION_TEMPLATE,
+            config.getBrokerTLSUrl(),
+            sslConfig.getTrustStorePath(),
+            sslConfig.getTrustStorePasswordProvider().getPassword(),
+            sslConfig.getKeyStorePath(),
+            sslConfig.getKeyStorePasswordProvider().getPassword(),
+            sslConfig.getKeyManagerPasswordProvider().getPassword()
+        )
+    };
+    // ensure that wikipedia segments are loaded completely
+    dataLoaderHelper.waitUntilDatasourceIsReady(WIKIPEDIA_DATA_SOURCE);
+  }
+
+  @Test
+  public void testJdbcMetadata()
+  {
+    for (String url : connections) {
+      try (Connection connection = DriverManager.getConnection(url, 
connectionProperties)) {
+        DatabaseMetaData metadata = connection.getMetaData();
+
+        List<String> catalogs = new ArrayList<>();
+        ResultSet catalogsMetadata = metadata.getCatalogs();
+        while (catalogsMetadata.next()) {
+          final String catalog = catalogsMetadata.getString(1);
+          catalogs.add(catalog);
+        }
+        LOG.info("catalogs %s", catalogs);
+        Assert.assertEquals(catalogs, ImmutableList.of("druid"));
+
+        Set<String> schemas = new HashSet<>();
+        ResultSet schemasMetadata = metadata.getSchemas("druid", null);
+        while (schemasMetadata.next()) {
+          final String schema = schemasMetadata.getString(1);
+          schemas.add(schema);
+        }
+        LOG.info("'druid' catalog schemas %s", schemas);
+        // maybe more schemas than this, but at least should have these
+        
Assert.assertTrue(schemas.containsAll(ImmutableList.of("INFORMATION_SCHEMA", 
"druid", "lookup", "sys")));
+
+        Set<String> druidTables = new HashSet<>();
+        ResultSet tablesMetadata = metadata.getTables("druid", "druid", null, 
null);
+        while (tablesMetadata.next()) {
+          final String table = tablesMetadata.getString(3);
+          druidTables.add(table);
+        }
+        LOG.info("'druid' schema tables %s", druidTables);
+        // maybe more tables than this, but at least should have these
+        Assert.assertTrue(
+            druidTables.containsAll(ImmutableList.of("twitterstream", 
"wikipedia", WIKIPEDIA_DATA_SOURCE))
+        );
+
+        Set<String> wikiColumns = new HashSet<>();
+        ResultSet columnsMetadata = metadata.getColumns("druid", "druid", 
WIKIPEDIA_DATA_SOURCE, null);
+        while (columnsMetadata.next()) {
+          final String column = columnsMetadata.getString(4);
+          wikiColumns.add(column);
+        }
+        LOG.info("'%s' columns %s", WIKIPEDIA_DATA_SOURCE, wikiColumns);
+        // a lot more columns than this, but at least should have these
+        Assert.assertTrue(
+            wikiColumns.containsAll(ImmutableList.of("added", "city", "delta", 
"language"))
+        );
+      }
+      catch (SQLException throwables) {
+        Assert.fail(throwables.getMessage());
+      }
+    }
+  }
+
+  @Test
+  public void testJdbcStatementQuery()
+  {
+    for (String url : connections) {
+      try (Connection connection = DriverManager.getConnection(url, 
connectionProperties)) {
+        try (Statement statement = connection.createStatement()) {
+          final ResultSet resultSet = statement.executeQuery(QUERY);
+          int resultRowCount = 0;
+          while (resultSet.next()) {
+            resultRowCount++;
+            LOG.info("%s,%s,%s", resultSet.getString(1), resultSet.getLong(2), 
resultSet.getLong(3));
+          }
+          Assert.assertEquals(resultRowCount, 10);
+          resultSet.close();
+        }
+      }
+      catch (SQLException throwables) {
+        Assert.fail(throwables.getMessage());
+      }
+    }
+  }
+
+  @Test
+  public void testJdbcPrepareStatementQuery()
+  {
+    for (String url : connections) {
+      try (Connection connection = DriverManager.getConnection(url, 
connectionProperties)) {
+        try (PreparedStatement statement = 
connection.prepareStatement(QUERY_PARAMETERIZED)) {
+          statement.setString(1, "en");
+          final ResultSet resultSet = statement.executeQuery();
+          int resultRowCount = 0;
+          while (resultSet.next()) {
+            resultRowCount++;
+            LOG.info("%s,%s,%s", resultSet.getString(1), resultSet.getLong(2), 
resultSet.getLong(3));
+          }
+          Assert.assertEquals(resultRowCount, 10);
+          resultSet.close();
+        }
+      }
+      catch (SQLException throwables) {
+        Assert.fail(throwables.getMessage());
+      }
+    }
+  }
+
+  @Rule
+  public ExpectedException expectedEx = ExpectedException.none();
+
+  @Test
+  public void testJdbcPrepareStatementQueryMissingParameters() throws 
SQLException
+  {
+    expectedEx.expect(AvaticaSqlException.class);
+    expectedEx.expectMessage(matchesRegex(".* Parameter at position \\[0] is 
not bound"));
+    for (String url : connections) {
+      Connection connection = DriverManager.getConnection(url, 
connectionProperties);
+      PreparedStatement statement = 
connection.prepareStatement(QUERY_PARAMETERIZED);

Review Comment:
   ## Potential database resource leak
   
   This PreparedStatement is not always closed on method exit.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/3713)



##########
integration-tests-ex/cases/src/test/java/org/apache/druid/testsEx/query/ITJdbcQueryTest.java:
##########
@@ -0,0 +1,232 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.testsEx.query;
+
+import static org.apache.druid.testsEx.utils.RegexMatchUtil.matchesRegex;
+
+import com.google.common.collect.ImmutableList;
+import com.google.inject.Inject;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import org.apache.calcite.avatica.AvaticaSqlException;
+import org.apache.druid.https.SSLClientConfig;
+import org.apache.druid.java.util.common.StringUtils;
+import org.apache.druid.java.util.common.logger.Logger;
+import org.apache.druid.testing.IntegrationTestingConfig;
+import org.apache.druid.testing.utils.DataLoaderHelper;
+import org.apache.druid.testsEx.categories.Query;
+import org.apache.druid.testsEx.config.DruidTestRunner;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+
+@RunWith(DruidTestRunner.class)
+@Category(Query.class)
+public class ITJdbcQueryTest
+{
+  private static final Logger LOG = new Logger(ITJdbcQueryTest.class);
+  private static final String WIKIPEDIA_DATA_SOURCE = "wikipedia_editstream";
+  private static final String CONNECTION_TEMPLATE = 
"jdbc:avatica:remote:url=%s/druid/v2/sql/avatica/";
+  private static final String TLS_CONNECTION_TEMPLATE =
+      
"jdbc:avatica:remote:url=%s/druid/v2/sql/avatica/;truststore=%s;truststore_password=%s;keystore=%s;keystore_password=%s;key_password=%s";
+
+  private static final String QUERY_TEMPLATE =
+      "SELECT \"user\", SUM(\"added\"), COUNT(*)" +
+      "FROM \"wikipedia\" " +
+      "WHERE \"__time\" >= CURRENT_TIMESTAMP - INTERVAL '10' YEAR AND 
\"language\" = %s" +
+      "GROUP BY 1 ORDER BY 3 DESC LIMIT 10";
+  private static final String QUERY = StringUtils.format(QUERY_TEMPLATE, 
"'en'");
+
+  private static final String QUERY_PARAMETERIZED = 
StringUtils.format(QUERY_TEMPLATE, "?");
+
+  private String[] connections;
+  private Properties connectionProperties;
+
+  @Inject
+  private IntegrationTestingConfig config;
+
+  @Inject
+  SSLClientConfig sslConfig;
+
+  @Inject
+  private DataLoaderHelper dataLoaderHelper;
+
+  @Before
+  public void before()
+  {
+    connectionProperties = new Properties();
+    connectionProperties.setProperty("user", "admin");
+    connectionProperties.setProperty("password", "priest");
+    connections = new String[]{
+        StringUtils.format(CONNECTION_TEMPLATE, config.getRouterUrl()),
+        StringUtils.format(CONNECTION_TEMPLATE, config.getBrokerUrl()),
+        StringUtils.format(
+            TLS_CONNECTION_TEMPLATE,
+            config.getRouterTLSUrl(),
+            sslConfig.getTrustStorePath(),
+            sslConfig.getTrustStorePasswordProvider().getPassword(),
+            sslConfig.getKeyStorePath(),
+            sslConfig.getKeyStorePasswordProvider().getPassword(),
+            sslConfig.getKeyManagerPasswordProvider().getPassword()
+        ),
+        StringUtils.format(
+            TLS_CONNECTION_TEMPLATE,
+            config.getBrokerTLSUrl(),
+            sslConfig.getTrustStorePath(),
+            sslConfig.getTrustStorePasswordProvider().getPassword(),
+            sslConfig.getKeyStorePath(),
+            sslConfig.getKeyStorePasswordProvider().getPassword(),
+            sslConfig.getKeyManagerPasswordProvider().getPassword()
+        )
+    };
+    // ensure that wikipedia segments are loaded completely
+    dataLoaderHelper.waitUntilDatasourceIsReady(WIKIPEDIA_DATA_SOURCE);
+  }
+
+  @Test
+  public void testJdbcMetadata()
+  {
+    for (String url : connections) {
+      try (Connection connection = DriverManager.getConnection(url, 
connectionProperties)) {
+        DatabaseMetaData metadata = connection.getMetaData();
+
+        List<String> catalogs = new ArrayList<>();
+        ResultSet catalogsMetadata = metadata.getCatalogs();
+        while (catalogsMetadata.next()) {
+          final String catalog = catalogsMetadata.getString(1);
+          catalogs.add(catalog);
+        }
+        LOG.info("catalogs %s", catalogs);
+        Assert.assertEquals(catalogs, ImmutableList.of("druid"));
+
+        Set<String> schemas = new HashSet<>();
+        ResultSet schemasMetadata = metadata.getSchemas("druid", null);
+        while (schemasMetadata.next()) {
+          final String schema = schemasMetadata.getString(1);
+          schemas.add(schema);
+        }
+        LOG.info("'druid' catalog schemas %s", schemas);
+        // maybe more schemas than this, but at least should have these
+        
Assert.assertTrue(schemas.containsAll(ImmutableList.of("INFORMATION_SCHEMA", 
"druid", "lookup", "sys")));
+
+        Set<String> druidTables = new HashSet<>();
+        ResultSet tablesMetadata = metadata.getTables("druid", "druid", null, 
null);
+        while (tablesMetadata.next()) {
+          final String table = tablesMetadata.getString(3);
+          druidTables.add(table);
+        }
+        LOG.info("'druid' schema tables %s", druidTables);
+        // maybe more tables than this, but at least should have these
+        Assert.assertTrue(
+            druidTables.containsAll(ImmutableList.of("twitterstream", 
"wikipedia", WIKIPEDIA_DATA_SOURCE))
+        );
+
+        Set<String> wikiColumns = new HashSet<>();
+        ResultSet columnsMetadata = metadata.getColumns("druid", "druid", 
WIKIPEDIA_DATA_SOURCE, null);
+        while (columnsMetadata.next()) {
+          final String column = columnsMetadata.getString(4);
+          wikiColumns.add(column);
+        }
+        LOG.info("'%s' columns %s", WIKIPEDIA_DATA_SOURCE, wikiColumns);
+        // a lot more columns than this, but at least should have these
+        Assert.assertTrue(
+            wikiColumns.containsAll(ImmutableList.of("added", "city", "delta", 
"language"))
+        );
+      }
+      catch (SQLException throwables) {
+        Assert.fail(throwables.getMessage());
+      }
+    }
+  }
+
+  @Test
+  public void testJdbcStatementQuery()
+  {
+    for (String url : connections) {
+      try (Connection connection = DriverManager.getConnection(url, 
connectionProperties)) {
+        try (Statement statement = connection.createStatement()) {
+          final ResultSet resultSet = statement.executeQuery(QUERY);
+          int resultRowCount = 0;
+          while (resultSet.next()) {
+            resultRowCount++;
+            LOG.info("%s,%s,%s", resultSet.getString(1), resultSet.getLong(2), 
resultSet.getLong(3));
+          }
+          Assert.assertEquals(resultRowCount, 10);
+          resultSet.close();
+        }
+      }
+      catch (SQLException throwables) {
+        Assert.fail(throwables.getMessage());
+      }
+    }
+  }
+
+  @Test
+  public void testJdbcPrepareStatementQuery()
+  {
+    for (String url : connections) {
+      try (Connection connection = DriverManager.getConnection(url, 
connectionProperties)) {
+        try (PreparedStatement statement = 
connection.prepareStatement(QUERY_PARAMETERIZED)) {
+          statement.setString(1, "en");
+          final ResultSet resultSet = statement.executeQuery();
+          int resultRowCount = 0;
+          while (resultSet.next()) {
+            resultRowCount++;
+            LOG.info("%s,%s,%s", resultSet.getString(1), resultSet.getLong(2), 
resultSet.getLong(3));
+          }
+          Assert.assertEquals(resultRowCount, 10);
+          resultSet.close();
+        }
+      }
+      catch (SQLException throwables) {
+        Assert.fail(throwables.getMessage());
+      }
+    }
+  }
+
+  @Rule
+  public ExpectedException expectedEx = ExpectedException.none();
+
+  @Test
+  public void testJdbcPrepareStatementQueryMissingParameters() throws 
SQLException
+  {
+    expectedEx.expect(AvaticaSqlException.class);
+    expectedEx.expectMessage(matchesRegex(".* Parameter at position \\[0] is 
not bound"));
+    for (String url : connections) {
+      Connection connection = DriverManager.getConnection(url, 
connectionProperties);
+      PreparedStatement statement = 
connection.prepareStatement(QUERY_PARAMETERIZED);
+      statement.executeQuery();

Review Comment:
   ## Potential database resource leak
   
   This ResultSet is not always closed on method exit.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/3714)



##########
integration-tests-ex/cases/src/test/java/org/apache/druid/testsEx/query/ITJdbcQueryTest.java:
##########
@@ -0,0 +1,232 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.testsEx.query;
+
+import static org.apache.druid.testsEx.utils.RegexMatchUtil.matchesRegex;
+
+import com.google.common.collect.ImmutableList;
+import com.google.inject.Inject;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import org.apache.calcite.avatica.AvaticaSqlException;
+import org.apache.druid.https.SSLClientConfig;
+import org.apache.druid.java.util.common.StringUtils;
+import org.apache.druid.java.util.common.logger.Logger;
+import org.apache.druid.testing.IntegrationTestingConfig;
+import org.apache.druid.testing.utils.DataLoaderHelper;
+import org.apache.druid.testsEx.categories.Query;
+import org.apache.druid.testsEx.config.DruidTestRunner;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+
+@RunWith(DruidTestRunner.class)
+@Category(Query.class)
+public class ITJdbcQueryTest
+{
+  private static final Logger LOG = new Logger(ITJdbcQueryTest.class);
+  private static final String WIKIPEDIA_DATA_SOURCE = "wikipedia_editstream";
+  private static final String CONNECTION_TEMPLATE = 
"jdbc:avatica:remote:url=%s/druid/v2/sql/avatica/";
+  private static final String TLS_CONNECTION_TEMPLATE =
+      
"jdbc:avatica:remote:url=%s/druid/v2/sql/avatica/;truststore=%s;truststore_password=%s;keystore=%s;keystore_password=%s;key_password=%s";
+
+  private static final String QUERY_TEMPLATE =
+      "SELECT \"user\", SUM(\"added\"), COUNT(*)" +
+      "FROM \"wikipedia\" " +
+      "WHERE \"__time\" >= CURRENT_TIMESTAMP - INTERVAL '10' YEAR AND 
\"language\" = %s" +
+      "GROUP BY 1 ORDER BY 3 DESC LIMIT 10";
+  private static final String QUERY = StringUtils.format(QUERY_TEMPLATE, 
"'en'");
+
+  private static final String QUERY_PARAMETERIZED = 
StringUtils.format(QUERY_TEMPLATE, "?");
+
+  private String[] connections;
+  private Properties connectionProperties;
+
+  @Inject
+  private IntegrationTestingConfig config;
+
+  @Inject
+  SSLClientConfig sslConfig;
+
+  @Inject
+  private DataLoaderHelper dataLoaderHelper;
+
+  @Before
+  public void before()
+  {
+    connectionProperties = new Properties();
+    connectionProperties.setProperty("user", "admin");
+    connectionProperties.setProperty("password", "priest");
+    connections = new String[]{
+        StringUtils.format(CONNECTION_TEMPLATE, config.getRouterUrl()),
+        StringUtils.format(CONNECTION_TEMPLATE, config.getBrokerUrl()),
+        StringUtils.format(
+            TLS_CONNECTION_TEMPLATE,
+            config.getRouterTLSUrl(),
+            sslConfig.getTrustStorePath(),
+            sslConfig.getTrustStorePasswordProvider().getPassword(),
+            sslConfig.getKeyStorePath(),
+            sslConfig.getKeyStorePasswordProvider().getPassword(),
+            sslConfig.getKeyManagerPasswordProvider().getPassword()
+        ),
+        StringUtils.format(
+            TLS_CONNECTION_TEMPLATE,
+            config.getBrokerTLSUrl(),
+            sslConfig.getTrustStorePath(),
+            sslConfig.getTrustStorePasswordProvider().getPassword(),
+            sslConfig.getKeyStorePath(),
+            sslConfig.getKeyStorePasswordProvider().getPassword(),
+            sslConfig.getKeyManagerPasswordProvider().getPassword()
+        )
+    };
+    // ensure that wikipedia segments are loaded completely
+    dataLoaderHelper.waitUntilDatasourceIsReady(WIKIPEDIA_DATA_SOURCE);
+  }
+
+  @Test
+  public void testJdbcMetadata()
+  {
+    for (String url : connections) {
+      try (Connection connection = DriverManager.getConnection(url, 
connectionProperties)) {
+        DatabaseMetaData metadata = connection.getMetaData();
+
+        List<String> catalogs = new ArrayList<>();
+        ResultSet catalogsMetadata = metadata.getCatalogs();
+        while (catalogsMetadata.next()) {
+          final String catalog = catalogsMetadata.getString(1);
+          catalogs.add(catalog);
+        }
+        LOG.info("catalogs %s", catalogs);
+        Assert.assertEquals(catalogs, ImmutableList.of("druid"));
+
+        Set<String> schemas = new HashSet<>();
+        ResultSet schemasMetadata = metadata.getSchemas("druid", null);
+        while (schemasMetadata.next()) {
+          final String schema = schemasMetadata.getString(1);
+          schemas.add(schema);
+        }
+        LOG.info("'druid' catalog schemas %s", schemas);
+        // maybe more schemas than this, but at least should have these
+        
Assert.assertTrue(schemas.containsAll(ImmutableList.of("INFORMATION_SCHEMA", 
"druid", "lookup", "sys")));
+
+        Set<String> druidTables = new HashSet<>();
+        ResultSet tablesMetadata = metadata.getTables("druid", "druid", null, 
null);
+        while (tablesMetadata.next()) {
+          final String table = tablesMetadata.getString(3);
+          druidTables.add(table);
+        }
+        LOG.info("'druid' schema tables %s", druidTables);
+        // maybe more tables than this, but at least should have these
+        Assert.assertTrue(
+            druidTables.containsAll(ImmutableList.of("twitterstream", 
"wikipedia", WIKIPEDIA_DATA_SOURCE))
+        );
+
+        Set<String> wikiColumns = new HashSet<>();
+        ResultSet columnsMetadata = metadata.getColumns("druid", "druid", 
WIKIPEDIA_DATA_SOURCE, null);
+        while (columnsMetadata.next()) {
+          final String column = columnsMetadata.getString(4);
+          wikiColumns.add(column);
+        }
+        LOG.info("'%s' columns %s", WIKIPEDIA_DATA_SOURCE, wikiColumns);
+        // a lot more columns than this, but at least should have these
+        Assert.assertTrue(
+            wikiColumns.containsAll(ImmutableList.of("added", "city", "delta", 
"language"))
+        );
+      }
+      catch (SQLException throwables) {
+        Assert.fail(throwables.getMessage());
+      }
+    }
+  }
+
+  @Test
+  public void testJdbcStatementQuery()
+  {
+    for (String url : connections) {
+      try (Connection connection = DriverManager.getConnection(url, 
connectionProperties)) {
+        try (Statement statement = connection.createStatement()) {
+          final ResultSet resultSet = statement.executeQuery(QUERY);
+          int resultRowCount = 0;
+          while (resultSet.next()) {
+            resultRowCount++;
+            LOG.info("%s,%s,%s", resultSet.getString(1), resultSet.getLong(2), 
resultSet.getLong(3));
+          }
+          Assert.assertEquals(resultRowCount, 10);
+          resultSet.close();
+        }
+      }
+      catch (SQLException throwables) {
+        Assert.fail(throwables.getMessage());
+      }
+    }
+  }
+
+  @Test
+  public void testJdbcPrepareStatementQuery()
+  {
+    for (String url : connections) {
+      try (Connection connection = DriverManager.getConnection(url, 
connectionProperties)) {
+        try (PreparedStatement statement = 
connection.prepareStatement(QUERY_PARAMETERIZED)) {
+          statement.setString(1, "en");
+          final ResultSet resultSet = statement.executeQuery();
+          int resultRowCount = 0;
+          while (resultSet.next()) {
+            resultRowCount++;
+            LOG.info("%s,%s,%s", resultSet.getString(1), resultSet.getLong(2), 
resultSet.getLong(3));
+          }
+          Assert.assertEquals(resultRowCount, 10);
+          resultSet.close();
+        }
+      }
+      catch (SQLException throwables) {
+        Assert.fail(throwables.getMessage());
+      }
+    }
+  }
+
+  @Rule
+  public ExpectedException expectedEx = ExpectedException.none();

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [ExpectedException.none](1) should be avoided because it has been 
deprecated.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/3711)



##########
integration-tests-ex/cases/src/test/java/org/apache/druid/testsEx/query/ITUnionQueryTest.java:
##########
@@ -0,0 +1,249 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.testsEx.query;
+
+import com.google.inject.Inject;
+import org.apache.commons.io.IOUtils;
+import org.apache.druid.curator.discovery.ServerDiscoveryFactory;
+import org.apache.druid.curator.discovery.ServerDiscoverySelector;
+import org.apache.druid.java.util.common.DateTimes;
+import org.apache.druid.java.util.common.ISE;
+import org.apache.druid.java.util.common.Intervals;
+import org.apache.druid.java.util.common.StringUtils;
+import org.apache.druid.java.util.common.io.Closer;
+import org.apache.druid.java.util.common.logger.Logger;
+import org.apache.druid.java.util.http.client.HttpClient;
+import org.apache.druid.java.util.http.client.Request;
+import org.apache.druid.java.util.http.client.response.StatusResponseHandler;
+import org.apache.druid.java.util.http.client.response.StatusResponseHolder;
+import org.apache.druid.query.aggregation.LongSumAggregatorFactory;
+import org.apache.druid.testing.IntegrationTestingConfig;
+import org.apache.druid.testing.clients.EventReceiverFirehoseTestClient;
+import org.apache.druid.testing.guice.TestClient;
+import org.apache.druid.testing.utils.ITRetryUtil;
+import org.apache.druid.testing.utils.ServerDiscoveryUtil;
+import org.apache.druid.testsEx.indexer.AbstractITBatchIndexTest;
+import org.apache.druid.testsEx.indexer.AbstractIndexerTest;
+import org.apache.druid.testsEx.categories.Query;
+import org.apache.druid.testsEx.config.DruidTestRunner;
+import org.jboss.netty.handler.codec.http.HttpMethod;
+import org.jboss.netty.handler.codec.http.HttpResponseStatus;
+import org.joda.time.DateTime;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+@RunWith(DruidTestRunner.class)
+@Category(Query.class)
+public class ITUnionQueryTest extends AbstractIndexerTest
+{
+  private static final Logger LOG = new Logger(ITUnionQueryTest.class);
+  private static final String UNION_TASK_RESOURCE = 
"/indexer/wikipedia_union_index_task.json";
+  private static final String EVENT_RECEIVER_SERVICE_PREFIX = 
"eventReceiverServiceName";
+  private static final String UNION_DATA_FILE = 
"/data/union_query/wikipedia_index_data.json";
+  private static final String UNION_QUERIES_RESOURCE = 
"/queries/union_queries.json";
+  private static final String UNION_DATASOURCE = "wikipedia_index_test";
+
+  @Inject
+  ServerDiscoveryFactory factory;
+
+  @Inject
+  @TestClient
+  HttpClient httpClient;
+
+  @Inject
+  IntegrationTestingConfig config;

Review Comment:
   ## Field masks field in super class
   
   This field shadows another field called [config](1) in a superclass.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/3718)



##########
integration-tests-ex/cases/src/test/java/org/apache/druid/testsEx/query/ITBroadcastJoinQueryTest.java:
##########
@@ -0,0 +1,167 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.testsEx.query;
+
+import com.google.common.collect.ImmutableList;
+import com.google.inject.Inject;
+import org.apache.druid.curator.discovery.ServerDiscoveryFactory;
+import org.apache.druid.java.util.common.StringUtils;
+import org.apache.druid.java.util.common.io.Closer;
+import org.apache.druid.java.util.common.logger.Logger;
+import org.apache.druid.java.util.http.client.HttpClient;
+import 
org.apache.druid.server.coordinator.rules.ForeverBroadcastDistributionRule;
+import org.apache.druid.testing.IntegrationTestingConfig;
+import org.apache.druid.testing.clients.CoordinatorResourceTestClient;
+import org.apache.druid.testing.guice.TestClient;
+import org.apache.druid.testing.utils.DataLoaderHelper;
+import org.apache.druid.testing.utils.ITRetryUtil;
+import org.apache.druid.testing.utils.SqlTestQueryHelper;
+import org.apache.druid.testsEx.indexer.AbstractIndexerTest;
+import org.apache.druid.testsEx.categories.Query;
+import org.apache.druid.testsEx.config.DruidTestRunner;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+@RunWith(DruidTestRunner.class)
+@Category(Query.class)
+public class ITBroadcastJoinQueryTest extends AbstractIndexerTest
+{
+  private static final Logger LOG = new Logger(ITBroadcastJoinQueryTest.class);
+  private static final String BROADCAST_JOIN_TASK = 
"/indexer/broadcast_join_index_task.json";
+  private static final String BROADCAST_JOIN_METADATA_QUERIES_RESOURCE = 
"/queries/broadcast_join_metadata_queries.json";
+  private static final String 
BROADCAST_JOIN_METADATA_QUERIES_AFTER_DROP_RESOURCE = 
"/queries/broadcast_join_after_drop_metadata_queries.json";
+  private static final String BROADCAST_JOIN_QUERIES_RESOURCE = 
"/queries/broadcast_join_queries.json";
+  private static final String BROADCAST_JOIN_DATASOURCE = 
"broadcast_join_wikipedia_test";
+
+
+  @Inject
+  ServerDiscoveryFactory factory;
+
+  @Inject
+  CoordinatorResourceTestClient coordinatorClient;
+
+  @Inject
+  SqlTestQueryHelper queryHelper;
+
+  @Inject
+  DataLoaderHelper dataLoaderHelper;
+
+  @Inject
+  @TestClient
+  HttpClient httpClient;
+
+  @Inject
+  IntegrationTestingConfig config;

Review Comment:
   ## Field masks field in super class
   
   This field shadows another field called [config](1) in a superclass.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/3716)



##########
integration-tests-ex/cases/src/test/java/org/apache/druid/testsEx/query/ITQueryErrorTest.java:
##########
@@ -0,0 +1,248 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.testsEx.query;
+
+import static org.apache.druid.testsEx.utils.RegexMatchUtil.matchesRegex;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.inject.Inject;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.druid.java.util.common.StringUtils;
+import org.apache.druid.query.QueryContexts;
+import org.apache.druid.server.coordination.ServerManagerForQueryErrorTest;
+import org.apache.druid.testing.utils.DataLoaderHelper;
+import org.apache.druid.testing.utils.SqlTestQueryHelper;
+import org.apache.druid.testing.utils.TestQueryHelper;
+import org.apache.druid.testsEx.categories.QueryError;
+import org.apache.druid.testsEx.indexer.AbstractIndexerTest;
+import org.apache.druid.testsEx.config.DruidTestRunner;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+
+/**
+ * This class tests various query failures.
+ *
+ * - SQL planning failures. Both {@link 
org.apache.calcite.sql.parser.SqlParseException}
+ *   and {@link org.apache.calcite.tools.ValidationException} are tested using 
SQLs that must fail.
+ * - Various query errors from historicals. These tests use {@link 
ServerManagerForQueryErrorTest} to make
+ *   the query to always throw an exception. They verify the error code 
returned by
+ *   {@link org.apache.druid.sql.http.SqlResource} and {@link 
org.apache.druid.server.QueryResource}.
+ */
+@RunWith(DruidTestRunner.class)
+@Category(QueryError.class)
+public class ITQueryErrorTest
+{
+  private static final String WIKIPEDIA_DATA_SOURCE = "wikipedia_editstream";
+  /**
+   * A simple query used for error tests from historicals. What query is does 
not matter because the query is always
+   * expected to fail.
+   *
+   * @see ServerManagerForQueryErrorTest#buildQueryRunnerForSegment
+   */
+  private static final String NATIVE_QUERY_RESOURCE =
+      "/queries/native_query_error_from_historicals_test.json";
+  private static final String SQL_QUERY_RESOURCE =
+      "/queries/sql_error_from_historicals_test.json";
+  /**
+   * A simple sql query template used for plan failure tests.
+   */
+  private static final String SQL_PLAN_FAILURE_RESOURCE = 
"/queries/sql_plan_failure_query.json";
+
+  @Inject
+  private DataLoaderHelper dataLoaderHelper;
+  @Inject
+  private TestQueryHelper queryHelper;
+  @Inject
+  private SqlTestQueryHelper sqlHelper;
+  @Inject
+  private ObjectMapper jsonMapper;
+
+  @Before
+  public void before()
+  {
+    // ensure that wikipedia segments are loaded completely
+    dataLoaderHelper.waitUntilDatasourceIsReady(WIKIPEDIA_DATA_SOURCE);
+  }
+
+  @Rule
+  public ExpectedException expectedEx = ExpectedException.none();

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [ExpectedException.none](1) should be avoided because it has been 
deprecated.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/3712)



##########
integration-tests-ex/cases/src/test/java/org/apache/druid/testsEx/query/ITBroadcastJoinQueryTest.java:
##########
@@ -0,0 +1,167 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.testsEx.query;
+
+import com.google.common.collect.ImmutableList;
+import com.google.inject.Inject;
+import org.apache.druid.curator.discovery.ServerDiscoveryFactory;
+import org.apache.druid.java.util.common.StringUtils;
+import org.apache.druid.java.util.common.io.Closer;
+import org.apache.druid.java.util.common.logger.Logger;
+import org.apache.druid.java.util.http.client.HttpClient;
+import 
org.apache.druid.server.coordinator.rules.ForeverBroadcastDistributionRule;
+import org.apache.druid.testing.IntegrationTestingConfig;
+import org.apache.druid.testing.clients.CoordinatorResourceTestClient;
+import org.apache.druid.testing.guice.TestClient;
+import org.apache.druid.testing.utils.DataLoaderHelper;
+import org.apache.druid.testing.utils.ITRetryUtil;
+import org.apache.druid.testing.utils.SqlTestQueryHelper;
+import org.apache.druid.testsEx.indexer.AbstractIndexerTest;
+import org.apache.druid.testsEx.categories.Query;
+import org.apache.druid.testsEx.config.DruidTestRunner;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+@RunWith(DruidTestRunner.class)
+@Category(Query.class)
+public class ITBroadcastJoinQueryTest extends AbstractIndexerTest
+{
+  private static final Logger LOG = new Logger(ITBroadcastJoinQueryTest.class);
+  private static final String BROADCAST_JOIN_TASK = 
"/indexer/broadcast_join_index_task.json";
+  private static final String BROADCAST_JOIN_METADATA_QUERIES_RESOURCE = 
"/queries/broadcast_join_metadata_queries.json";
+  private static final String 
BROADCAST_JOIN_METADATA_QUERIES_AFTER_DROP_RESOURCE = 
"/queries/broadcast_join_after_drop_metadata_queries.json";
+  private static final String BROADCAST_JOIN_QUERIES_RESOURCE = 
"/queries/broadcast_join_queries.json";
+  private static final String BROADCAST_JOIN_DATASOURCE = 
"broadcast_join_wikipedia_test";
+
+
+  @Inject
+  ServerDiscoveryFactory factory;
+
+  @Inject
+  CoordinatorResourceTestClient coordinatorClient;
+
+  @Inject
+  SqlTestQueryHelper queryHelper;

Review Comment:
   ## Field masks field in super class
   
   This field shadows another field called [queryHelper](1) in a superclass.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/3717)



##########
integration-tests-ex/cases/src/test/java/org/apache/druid/testsEx/query/ITWikipediaQueryTest.java:
##########
@@ -0,0 +1,226 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.testsEx.query;
+
+import com.fasterxml.jackson.jaxrs.smile.SmileMediaTypes;
+import com.google.common.collect.ImmutableMap;
+import com.google.inject.Inject;
+import javax.ws.rs.core.MediaType;
+import junitparams.Parameters;
+import org.apache.druid.java.util.common.logger.Logger;
+import org.apache.druid.java.util.http.client.response.StatusResponseHolder;
+import org.apache.druid.query.Druids;
+import org.apache.druid.query.QueryCapacityExceededException;
+import org.apache.druid.query.aggregation.CountAggregatorFactory;
+import org.apache.druid.testing.IntegrationTestingConfig;
+import org.apache.druid.testing.clients.CoordinatorResourceTestClient;
+import org.apache.druid.testing.clients.QueryResourceTestClient;
+import org.apache.druid.testing.utils.ITRetryUtil;
+import org.apache.druid.testing.utils.TestQueryHelper;
+import org.apache.druid.testsEx.categories.Query;
+import org.apache.druid.testsEx.config.DruidTestRunner;
+import org.jboss.netty.handler.codec.http.HttpResponseStatus;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+import org.testng.Assert;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+import java.util.concurrent.Future;
+
+@RunWith(DruidTestRunner.class)
+@Category(Query.class)
+public class ITWikipediaQueryTest
+{
+  private static final Logger LOG = new Logger(ITWikipediaQueryTest.class);
+
+  public static final String WIKIPEDIA_DATA_SOURCE = "wikipedia_editstream";
+  private static final String WIKI_LOOKUP = "wiki-simple";
+  private static final String WIKIPEDIA_QUERIES_RESOURCE = 
"/queries/wikipedia_editstream_queries.json";
+  private static final String WIKIPEDIA_LOOKUP_RESOURCE = 
"/queries/wiki-lookup-config.json";
+
+  @Inject
+  private CoordinatorResourceTestClient coordinatorClient;
+  @Inject
+  private TestQueryHelper queryHelper;
+  @Inject
+  private QueryResourceTestClient queryClient;
+  @Inject
+  private IntegrationTestingConfig config;
+
+  @Before
+  public void before() throws Exception
+  {
+    // ensure that wikipedia segments are loaded completely
+    ITRetryUtil.retryUntilTrue(
+        () -> coordinatorClient.areSegmentsLoaded(WIKIPEDIA_DATA_SOURCE), 
"wikipedia segment load"
+    );
+    if (!coordinatorClient.areLookupsLoaded(WIKI_LOOKUP)) {
+      coordinatorClient.initializeLookups(WIKIPEDIA_LOOKUP_RESOURCE);
+      ITRetryUtil.retryUntilTrue(
+          () -> coordinatorClient.areLookupsLoaded(WIKI_LOOKUP), "wikipedia 
lookup load"
+      );
+    }
+  }
+
+  /**
+   * A combination of request Content-Type and Accept HTTP header
+   * The first is Content-Type which can not be null while the 2nd is Accept 
which could be null
+   * <p>
+   * When Accept is null, its value defaults to value of Content-Type
+   */
+  public static Object[][] encodingCombination()
+  {
+    return new Object[][]{
+        {MediaType.APPLICATION_JSON, null},
+        {MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON},
+        {MediaType.APPLICATION_JSON, 
SmileMediaTypes.APPLICATION_JACKSON_SMILE},
+        {SmileMediaTypes.APPLICATION_JACKSON_SMILE, null},
+        {SmileMediaTypes.APPLICATION_JACKSON_SMILE, 
MediaType.APPLICATION_JSON},
+        {SmileMediaTypes.APPLICATION_JACKSON_SMILE, 
SmileMediaTypes.APPLICATION_JACKSON_SMILE},
+        };
+  }
+
+  @Test
+  @Parameters(method = "encodingCombination")
+  public void testWikipediaQueriesFromFile(String contentType, String accept)
+      throws Exception
+  {
+    // run tests on a new query helper
+    TestQueryHelper queryHelper = this.queryHelper.withEncoding(contentType, 
accept);

Review Comment:
   ## Possible confusion of local and field
   
   Potentially confusing name: method [testWikipediaQueriesFromFile](1) also 
refers to field [queryHelper](2) (as this.queryHelper).
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/3715)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to