File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
spark-bigquery-connector-common/src/test/java/com/google/cloud/spark/bigquery Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 1515 */
1616package com .google .cloud .spark .bigquery .acceptance ;
1717
18- import com .google .cloud .ServiceOptions ;
1918import com .google .common .base .Preconditions ;
20- import java .util .Optional ;
2119
2220public class AcceptanceTestConstants {
2321
2422 public static final String REGION = "us-west1" ;
2523 public static final String DATAPROC_ENDPOINT = REGION + "-dataproc.googleapis.com:443" ;
2624 public static final String PROJECT_ID =
27- Optional .ofNullable (System .getenv ("GOOGLE_CLOUD_PROJECT" ))
28- .orElse (ServiceOptions .getDefaultProjectId ());
25+ Preconditions .checkNotNull (
26+ System .getenv ("GOOGLE_CLOUD_PROJECT" ),
27+ "Please set the 'GOOGLE_CLOUD_PROJECT' environment variable" );
2928 public static final String SERVERLESS_NETWORK_URI =
3029 Preconditions .checkNotNull (
3130 System .getenv ("SERVERLESS_NETWORK_URI" ),
Original file line number Diff line number Diff line change 3232import static org .apache .spark .sql .types .DataTypes .StringType ;
3333import static org .apache .spark .sql .types .DataTypes .TimestampType ;
3434
35- import com .google .cloud .ServiceOptions ;
3635import com .google .cloud .spark .bigquery .integration .model .ColumnOrderTestClass ;
3736import com .google .cloud .spark .bigquery .integration .model .NumStruct ;
3837import com .google .cloud .spark .bigquery .integration .model .StringStruct ;
4443import java .sql .Timestamp ;
4544import java .util .Arrays ;
4645import java .util .List ;
47- import java .util .Optional ;
4846import java .util .TimeZone ;
4947import java .util .stream .Collectors ;
5048import java .util .stream .Stream ;
@@ -75,8 +73,9 @@ public class TestConstants {
7573 "bigquery-public-data.wikipedia.pageviews_2021" ;
7674 static final long SHAKESPEARE_TABLE_NUM_ROWS = 164656L ;
7775 static final String PROJECT_ID =
78- Optional .ofNullable (System .getenv ("GOOGLE_CLOUD_PROJECT" ))
79- .orElse (ServiceOptions .getDefaultProjectId ());
76+ Preconditions .checkNotNull (
77+ System .getenv ("GOOGLE_CLOUD_PROJECT" ),
78+ "Please set the GOOGLE_CLOUD_PROJECT env variable" );
8079 static final String TEMPORARY_GCS_BUCKET_ENV_VARIABLE = "TEMPORARY_GCS_BUCKET" ;
8180 static final String BIGLAKE_CONNECTION_ID_ENV_VARIABLE = "BIGLAKE_CONNECTION_ID" ;
8281 static final String TEMPORARY_GCS_BUCKET =
You can’t perform that action at this time.
0 commit comments