Skip to content

Commit f35d3a5

Browse files
committed
Fix compilation
1 parent 3c44fa7 commit f35d3a5

5 files changed

Lines changed: 21 additions & 24 deletions

File tree

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITAuthTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void testValidServiceAccountAuthentication() throws SQLException, IOExcep
9191
Files.write(tempFile.toPath(), authJson.toString().getBytes());
9292

9393
String connection_uri =
94-
getBaseConnectionUrl() + ""
94+
getBaseConnectionUrl()
9595
+ "ProjectId="
9696
+ authJson.get("project_id").getAsString()
9797
+ ";OAuthType=0;"
@@ -106,7 +106,7 @@ public void testValidServiceAccountAuthentication() throws SQLException, IOExcep
106106
@Test
107107
public void testServiceAccountAuthenticationMissingOAuthPvtKeyPath() throws SQLException {
108108
String connection_uri =
109-
getBaseConnectionUrl() + ""
109+
getBaseConnectionUrl()
110110
+ "ProjectId="
111111
+ PROJECT_ID
112112
+ ";OAuthType=0;";
@@ -128,7 +128,7 @@ public void testValidServiceAccountAuthenticationOAuthPvtKeyAsPath()
128128
Files.write(tempFile.toPath(), authJson.toString().getBytes());
129129

130130
String connection_uri =
131-
getBaseConnectionUrl() + ""
131+
getBaseConnectionUrl()
132132
+ "ProjectId="
133133
+ authJson.get("project_id").getAsString()
134134
+ ";OAuthType=0;"
@@ -145,7 +145,7 @@ public void testValidServiceAccountAuthenticationViaEmailAndPkcs8Key()
145145
final JsonObject authJson = getAuthJson();
146146

147147
String connection_uri =
148-
getBaseConnectionUrl() + ""
148+
getBaseConnectionUrl()
149149
+ "ProjectId="
150150
+ authJson.get("project_id").getAsString()
151151
+ ";OAuthType=0;"
@@ -163,7 +163,7 @@ public void testValidServiceAccountAuthenticationOAuthPvtKeyAsJson()
163163
final JsonObject authJson = getAuthJson();
164164

165165
String connection_uri =
166-
getBaseConnectionUrl() + ""
166+
getBaseConnectionUrl()
167167
+ "ProjectId="
168168
+ authJson.get("project_id").getAsString()
169169
+ ";OAuthType=0;"

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITBigQueryJDBCTest.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public void testInvalidQuery() throws SQLException {
294294
@Test
295295
public void testDriver() throws SQLException {
296296
String connection_uri =
297-
ITBigQueryJDBCTest.connection_uri + "";
297+
ITBigQueryJDBCTest.connection_uri;
298298

299299
Driver driver = BigQueryDriver.getRegisteredDriver();
300300
assertTrue(driver.acceptsURL(connection_uri));
@@ -322,7 +322,7 @@ public void testDefaultDataset() throws SQLException {
322322
connection.unwrap(BigQueryConnection.class).getDefaultDataset());
323323

324324
String connection_uri_null_default_dataset =
325-
ITBigQueryJDBCTest.connection_uri + "";
325+
ITBigQueryJDBCTest.connection_uri;
326326

327327
assertTrue(driver.acceptsURL(connection_uri_null_default_dataset));
328328

@@ -371,7 +371,7 @@ public void testLocation() throws SQLException {
371371
assertEquals(100, resultSetRowCount(resultSet));
372372

373373
String connection_uri_null_location =
374-
ITBigQueryJDBCTest.connection_uri + "";
374+
ITBigQueryJDBCTest.connection_uri;
375375

376376
assertTrue(driver.acceptsURL(connection_uri_null_location));
377377

@@ -1322,7 +1322,7 @@ public void testValidLEPEndpointQuery() throws SQLException {
13221322
String TABLE_NAME = "REGIONAL_TABLE";
13231323
String selectQuery = "select * from " + DATASET + "." + TABLE_NAME;
13241324
String connection_uri =
1325-
ITBigQueryJDBCTest.connection_uri + ""
1325+
ITBigQueryJDBCTest.connection_uri
13261326
+ "EndpointOverrides=BIGQUERY=https://us-east4-bigquery.googleapis.com;";
13271327

13281328
// Read data via JDBC
@@ -1338,7 +1338,7 @@ public void testValidEndpointWithInvalidBQPortThrows() throws SQLException {
13381338
String TABLE_NAME = "JDBC_REGIONAL_TABLE_" + randomNumber;
13391339
String selectQuery = "select * from " + DATASET + "." + TABLE_NAME;
13401340
String connection_uri =
1341-
ITBigQueryJDBCTest.connection_uri + ""
1341+
ITBigQueryJDBCTest.connection_uri
13421342
+ "EndpointOverrides=BIGQUERY=https://us-east4-bigquery.googleapis.com:12312312;";
13431343

13441344
// Read data via JDBC
@@ -1354,7 +1354,7 @@ public void testLEPEndpointDataNotFoundThrows() throws SQLException {
13541354
String TABLE_NAME = "REGIONAL_TABLE";
13551355
String selectQuery = "select * from " + DATASET + "." + TABLE_NAME;
13561356
String connection_uri =
1357-
ITBigQueryJDBCTest.connection_uri + ""
1357+
ITBigQueryJDBCTest.connection_uri
13581358
+ "EndpointOverrides=BIGQUERY=https://us-east5-bigquery.googleapis.com;";
13591359

13601360
// Attempting read data via JDBC
@@ -1370,7 +1370,7 @@ public void testValidREPEndpointQuery() throws SQLException {
13701370
String TABLE_NAME = "REGIONAL_TABLE";
13711371
String selectQuery = "select * from " + DATASET + "." + TABLE_NAME;
13721372
String connection_uri =
1373-
ITBigQueryJDBCTest.connection_uri + ""
1373+
ITBigQueryJDBCTest.connection_uri
13741374
+ "EndpointOverrides=BIGQUERY=https://bigquery.us-east4.rep.googleapis.com;";
13751375

13761376
// Read data via JDBC
@@ -1387,7 +1387,7 @@ public void testREPEndpointDataNotFoundThrows() throws SQLException {
13871387
String TABLE_NAME = "REGIONAL_TABLE";
13881388
String selectQuery = "select * from " + DATASET + "." + TABLE_NAME;
13891389
String connection_uri =
1390-
ITBigQueryJDBCTest.connection_uri + ""
1390+
ITBigQueryJDBCTest.connection_uri
13911391
+ "EndpointOverrides=BIGQUERY=https://bigquery.us-east7.rep.googleapis.com;";
13921392

13931393
// Attempting read data via JDBC
@@ -1463,7 +1463,7 @@ public void testConnectionIsValid() throws SQLException {
14631463
@Test
14641464
public void testDataSource() throws SQLException {
14651465
DataSource ds = new DataSource();
1466-
ds.setURL(getBaseConnectionUrl() + "");
1466+
ds.setURL(getBaseConnectionUrl());
14671467
ds.setOAuthType(3);
14681468

14691469
try (Connection connection = ds.getConnection()) {
@@ -1476,7 +1476,7 @@ public void testDataSourceOAuthPvtKeyPath() throws SQLException, IOException {
14761476
File tempFile = File.createTempFile("auth", ".json");
14771477
tempFile.deleteOnExit();
14781478
DataSource ds = new DataSource();
1479-
ds.setURL(getBaseConnectionUrl() + "");
1479+
ds.setURL(getBaseConnectionUrl());
14801480
ds.setOAuthType(0);
14811481
ds.setOAuthPvtKeyPath(tempFile.toPath().toString());
14821482
assertEquals(0, ds.getOAuthType().intValue());
@@ -1662,7 +1662,7 @@ public void testValidDestinationTableSavesQueriesWithLegacySQL() throws SQLExcep
16621662
public void testNonEnabledUseLegacySQLThrowsSyntaxError() throws SQLException {
16631663
// setup
16641664
String connection_uri =
1665-
ITBigQueryJDBCTest.connection_uri + "";
1665+
ITBigQueryJDBCTest.connection_uri;
16661666
String selectLegacyQuery =
16671667
"SELECT * FROM [bigquery-public-data.deepmind_alphafold.metadata] LIMIT 20000000;";
16681668
Connection connection = DriverManager.getConnection(connection_uri, new Properties());

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITConnectionPoolingTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,15 +276,14 @@ public void testPooledConnectionListenerConnectionError() throws SQLException {
276276

277277
@Test
278278
public void testExecuteQueryWithConnectionPoolingEnabledDefaultPoolSize() throws SQLException {
279-
String connectionURL = ITBase.connectionUrl + "";
279+
String connectionURL = ITBase.connectionUrl;
280280

281281
assertConnectionPoolingResults(connectionURL, DEFAULT_CONN_POOL_SIZE);
282282
}
283283

284284
@Test
285285
public void testExecuteQueryWithConnectionPoolingEnabledCustomPoolSize() throws SQLException {
286-
String connectionURL = ITBase.connectionUrl + "ConnectionPoolSize=CUSTOM_CONN_POOL_SIZE";
287-
";
286+
String connectionURL = ITBase.connectionUrl + "ConnectionPoolSize=" + CUSTOM_CONN_POOL_SIZE + ";";
288287
assertConnectionPoolingResults(connectionURL, CUSTOM_CONN_POOL_SIZE);
289288
}
290289

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITNightlyBigQueryTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ public void testQueryPropertySessionIdIsUsedWithTransaction()
13291329
bigQueryStatement.execute(createTransactionTable);
13301330

13311331
// Run the transaction
1332-
String connection_uri = ITNightlyBigQueryTest.connection_uri + "QueryProperties=session_id=sessionId";";
1332+
String connection_uri = ITNightlyBigQueryTest.connection_uri + "QueryProperties=session_id=" + sessionId + ";";
13331333
Driver driver = BigQueryDriver.getRegisteredDriver();
13341334
Connection connection = driver.connect(connection_uri, new Properties());
13351335
Statement statement = connection.createStatement();
@@ -1571,7 +1571,7 @@ public void testIterateOrderArrowMultiThread() throws SQLException {
15711571
@Test
15721572
public void testNonEnabledUseLegacySQLThrowsSyntaxError() throws SQLException {
15731573
// setup
1574-
String connection_uri = ITNightlyBigQueryTest.connection_uri + "";
1574+
String connection_uri = ITNightlyBigQueryTest.connection_uri;
15751575
String selectLegacyQuery =
15761576
"SELECT * FROM [bigquery-public-data.deepmind_alphafold.metadata] LIMIT 20000000;";
15771577
Driver driver = BigQueryDriver.getRegisteredDriver();

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITStatementTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,9 @@ private int resultSetRowCount(ResultSet resultSet) throws SQLException {
250250

251251
@Test
252252
public void testStringColumnLength() throws SQLException {
253-
String projectId = DEFAULT_CATALOG;
254253
String TABLE_NAME = "StringColumnLengthTable";
255-
String oauthType = "3"; // Google Application Credentials
256254
int length = 10;
257-
String connectionUrl = ITStatementTest.connectionUrl + "StringColumnLength=" + length + ";";;
255+
String connectionUrl = ITStatementTest.connectionUrl + "StringColumnLength=" + length + ";";
258256
// + "EnableSession=1";
259257
Connection connection1 = DriverManager.getConnection(connectionUrl);
260258
Statement statement = connection1.createStatement();

0 commit comments

Comments
 (0)