Skip to content

Commit e33bfa4

Browse files
committed
Remove the exception catch
1 parent cb3be81 commit e33bfa4

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

spark-bigquery-connector-common/src/test/java/com/google/cloud/spark/bigquery/integration/ReadFromQueryIntegrationTestBase.java

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -389,22 +389,14 @@ public void testReadFromQueryWithKmsKey() {
389389
String envKmsKey = System.getenv("BIGQUERY_KMS_KEY_NAME");
390390
String kmsKeyName =
391391
envKmsKey != null ? envKmsKey : "projects/p/locations/l/keyRings/k/cryptoKeys/c";
392-
try {
393-
spark
394-
.read()
395-
.format("bigquery")
396-
.option("viewsEnabled", true)
397-
.option("materializationDataset", testDataset.toString())
398-
.option("destinationTableKmsKeyName", kmsKeyName)
399-
.load(query)
400-
.collect();
401-
} catch (Exception e) {
402-
if (envKmsKey != null) {
403-
throw new RuntimeException("Query failed with provided KMS key", e);
404-
}
405-
// It is expected to fail as the KMS key is invalid
406-
}
407-
392+
spark
393+
.read()
394+
.format("bigquery")
395+
.option("viewsEnabled", true)
396+
.option("materializationDataset", testDataset.toString())
397+
.option("destinationTableKmsKeyName", kmsKeyName)
398+
.load(query)
399+
.collect();
408400
// validate event publishing
409401
List<JobInfo> jobInfos = listener.getJobInfos();
410402
assertThat(jobInfos).hasSize(1);

0 commit comments

Comments
 (0)