Skip to content

Commit b93e50b

Browse files
committed
Update unittest
1 parent ac2afdc commit b93e50b

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

java-bigquery/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDriverTest.java

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616
package com.google.cloud.bigquery.jdbc;
1717

1818
import static com.google.common.truth.Truth.assertThat;
19-
import static org.junit.jupiter.api.Assertions.fail;
2019

21-
import com.google.cloud.bigquery.exception.BigQueryJdbcException;
22-
import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException;
2320
import java.sql.Connection;
2421
import java.sql.DriverPropertyInfo;
2522
import java.sql.SQLException;
@@ -98,15 +95,13 @@ public void testJDBCCompliantReturnsFalse() {
9895
}
9996

10097
@Test
101-
public void testConnectWithInvalidUrlChainsException() {
102-
try {
103-
bigQueryDriver.connect(
104-
"jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;InvalidProperty=Value",
105-
new Properties());
106-
fail("Expected SQLException");
107-
} catch (SQLException e) {
108-
assertThat((Throwable) e).isInstanceOf(BigQueryJdbcException.class);
109-
assertThat(e.getCause()).isInstanceOf(BigQueryJdbcRuntimeException.class);
110-
}
98+
public void testConnectWithInvalidUrlChainsNoException() throws SQLException {
99+
Connection connection =
100+
bigQueryDriver.connect(
101+
"jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;"
102+
+ "OAuthType=2;OAuthAccessToken=redactedToken;ProjectId=t;"
103+
+ "InvalidProperty=Value",
104+
new Properties());
105+
assertThat(connection.isClosed()).isFalse();
111106
}
112107
}

0 commit comments

Comments
 (0)