Skip to content

Commit 8870ac0

Browse files
committed
lint
1 parent f35d3a5 commit 8870ac0

8 files changed

Lines changed: 113 additions & 95 deletions

File tree

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.google.cloud.bigquery.jdbc.it;
1818

19-
2019
import static org.junit.jupiter.api.Assertions.assertEquals;
2120
import static org.junit.jupiter.api.Assertions.assertFalse;
2221
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -105,11 +104,7 @@ public void testValidServiceAccountAuthentication() throws SQLException, IOExcep
105104

106105
@Test
107106
public void testServiceAccountAuthenticationMissingOAuthPvtKeyPath() throws SQLException {
108-
String connection_uri =
109-
getBaseConnectionUrl()
110-
+ "ProjectId="
111-
+ PROJECT_ID
112-
+ ";OAuthType=0;";
107+
String connection_uri = getBaseConnectionUrl() + "ProjectId=" + PROJECT_ID + ";OAuthType=0;";
113108

114109
try {
115110
DriverManager.getConnection(connection_uri);
@@ -193,7 +188,8 @@ public void testValidServiceAccountAuthenticationP12() throws SQLException, IOEx
193188
@Disabled
194189
public void testValidGoogleUserAccountAuthentication() throws SQLException {
195190
String connection_uri =
196-
getBaseConnectionUrl() + "PROJECTID="
191+
getBaseConnectionUrl()
192+
+ "PROJECTID="
197193
+ PROJECT_ID
198194
+ ";OAuthType=1;OAuthClientId=client_id;OAuthClientSecret=client_secret;";
199195

@@ -214,7 +210,8 @@ public void testValidGoogleUserAccountAuthentication() throws SQLException {
214210
@Disabled
215211
public void testValidExternalAccountAuthentication() throws SQLException {
216212
String connection_uri =
217-
getBaseConnectionUrl() + "PROJECTID="
213+
getBaseConnectionUrl()
214+
+ "PROJECTID="
218215
+ PROJECT_ID
219216
+ ";OAUTHTYPE=4;"
220217
+ "BYOID_AudienceUri=//iam.googleapis.com/projects/<project>/locations/<location>/workloadIdentityPools/<pool>/providers/<provider>;"
@@ -238,7 +235,8 @@ public void testValidExternalAccountAuthentication() throws SQLException {
238235
@Disabled
239236
public void testValidExternalAccountAuthenticationFromFile() throws SQLException {
240237
String connection_uri =
241-
getBaseConnectionUrl() + "PROJECTID="
238+
getBaseConnectionUrl()
239+
+ "PROJECTID="
242240
+ PROJECT_ID
243241
+ ";OAUTHTYPE=4;"
244242
+ "OAuthPvtKeyPath=/path/to/file;";
@@ -260,7 +258,8 @@ public void testValidExternalAccountAuthenticationFromFile() throws SQLException
260258
@Disabled
261259
public void testValidExternalAccountAuthenticationRawJson() throws SQLException {
262260
String connection_uri =
263-
getBaseConnectionUrl() + "PROJECTID="
261+
getBaseConnectionUrl()
262+
+ "PROJECTID="
264263
+ PROJECT_ID
265264
+ ";OAUTHTYPE=4;OAuthPvtKey={\n"
266265
+ " \"universe_domain\": \"googleapis.com\",\n"
@@ -304,7 +303,8 @@ public void testValidPreGeneratedAccessTokenAuthentication(String scope, boolean
304303
String accessToken = credentials.getAccessToken().getTokenValue();
305304

306305
String connectionUri =
307-
getBaseConnectionUrl() + "ProjectId="
306+
getBaseConnectionUrl()
307+
+ "ProjectId="
308308
+ authJson.get("project_id").getAsString()
309309
+ ";OAuthType=2"
310310
+ ";OAuthAccessToken="
@@ -320,7 +320,8 @@ public void testValidPreGeneratedAccessTokenAuthentication(String scope, boolean
320320
@Disabled
321321
public void testValidRefreshTokenAuthentication() throws SQLException {
322322
String connection_uri =
323-
getBaseConnectionUrl() + "PROJECTID="
323+
getBaseConnectionUrl()
324+
+ "PROJECTID="
324325
+ PROJECT_ID
325326
+ ";OAUTHTYPE=2;OAuthRefreshToken=refresh_token;"
326327
+ ";OAuthClientId=client;OAuthClientSecret=secret;";

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
package com.google.cloud.bigquery.jdbc.it;
1818

1919
import static org.junit.jupiter.api.Assertions.assertNotNull;
20-
import com.google.cloud.bigquery.jdbc.utils.TestUtilities;
2120

2221
import com.google.cloud.ServiceOptions;
2322
import com.google.cloud.bigquery.BigQuery;
2423
import com.google.cloud.bigquery.BigQueryOptions;
2524
import com.google.cloud.bigquery.QueryJobConfiguration;
2625
import com.google.cloud.bigquery.jdbc.BigQueryJdbcBaseTest;
26+
import com.google.cloud.bigquery.jdbc.utils.TestUtilities;
2727
import java.sql.Connection;
2828
import java.sql.ResultSet;
2929
import java.sql.SQLException;
@@ -183,10 +183,8 @@ public static String getBaseConnectionUrl() {
183183
return TestUtilities.getBaseConnectionUrl();
184184
}
185185

186-
public static String connectionUrl = getBaseConnectionUrl()
187-
+ "ProjectId="
188-
+ DEFAULT_CATALOG
189-
+ ";OAuthType=3;Timeout=3600;";
186+
public static String connectionUrl =
187+
getBaseConnectionUrl() + "ProjectId=" + DEFAULT_CATALOG + ";OAuthType=3;Timeout=3600;";
190188

191189
public static final String createDatasetQuery =
192190
"CREATE SCHEMA IF NOT EXISTS `%s.%s` OPTIONS(default_table_expiration_days = 5)";

0 commit comments

Comments
 (0)