Skip to content

Commit cb38b13

Browse files
committed
fix: update assertNotNull argument order and make bucket name configurable
1 parent 0dbf462 commit cb38b13

7 files changed

Lines changed: 22 additions & 16 deletions

File tree

healthcare/v1/src/test/java/snippets/healthcare/DatasetTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public class DatasetTests {
5555

5656
private static void requireEnvVar(String varName) {
5757
assertNotNull(
58-
System.getenv(varName),
59-
String.format("Environment variable '%s' is required to perform these tests.", varName));
58+
String.format("Environment variable '%s' is required to perform these tests.", varName),
59+
System.getenv(varName));
6060
}
6161

6262
@BeforeClass

healthcare/v1/src/test/java/snippets/healthcare/DicomStoreTests.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ public class DicomStoreTests {
4848
private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
4949
private static final String REGION_ID = "us-central1";
5050

51-
private static final String GCLOUD_BUCKET_NAME = "java-docs-samples-testing";
51+
private static final String GCLOUD_BUCKET_NAME =
52+
System.getenv("GCLOUD_BUCKET_NAME") != null
53+
? System.getenv("GCLOUD_BUCKET_NAME")
54+
: "java-docs-samples-testing";
5255
private static final String GCLOUD_PUBSUB_TOPIC = System.getenv("GCLOUD_PUBSUB_TOPIC");
5356

5457
private static String datasetName;
@@ -60,8 +63,8 @@ public class DicomStoreTests {
6063

6164
private static void requireEnvVar(String varName) {
6265
assertNotNull(
63-
System.getenv(varName),
64-
String.format("Environment variable '%s' is required to perform these tests.", varName));
66+
String.format("Environment variable '%s' is required to perform these tests.", varName),
67+
System.getenv(varName));
6568
}
6669

6770
@BeforeClass

healthcare/v1/src/test/java/snippets/healthcare/DicomWebTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ public class DicomWebTests {
7676

7777
private static void requireEnvVar(String varName) {
7878
assertNotNull(
79-
System.getenv(varName),
80-
String.format("Environment variable '%s' is required to perform these tests.", varName));
79+
String.format("Environment variable '%s' is required to perform these tests.", varName),
80+
System.getenv(varName));
8181
}
8282

8383
@BeforeClass

healthcare/v1/src/test/java/snippets/healthcare/FhirResourceTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ public class FhirResourceTests {
7474

7575
private static void requireEnvVar(String varName) {
7676
assertNotNull(
77-
System.getenv(varName),
78-
String.format("Environment variable \"%s\" is required to perform these tests.", varName));
77+
String.format("Environment variable \"%s\" is required to perform these tests.", varName),
78+
System.getenv(varName));
7979
}
8080

8181
@BeforeClass

healthcare/v1/src/test/java/snippets/healthcare/FhirStoreTests.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ public class FhirStoreTests {
5050
private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
5151
private static final String REGION_ID = "us-central1";
5252

53-
private static final String GCLOUD_BUCKET_NAME = "java-docs-samples-testing";
53+
private static final String GCLOUD_BUCKET_NAME =
54+
System.getenv("GCLOUD_BUCKET_NAME") != null
55+
? System.getenv("GCLOUD_BUCKET_NAME")
56+
: "java-docs-samples-testing";
5457
private static final String GCLOUD_PUBSUB_TOPIC = System.getenv("GCLOUD_PUBSUB_TOPIC");
5558

5659
private static String datasetName;
@@ -62,8 +65,8 @@ public class FhirStoreTests {
6265

6366
private static void requireEnvVar(String varName) {
6467
assertNotNull(
65-
System.getenv(varName),
66-
String.format("Environment variable '%s' is required to perform these tests.", varName));
68+
String.format("Environment variable '%s' is required to perform these tests.", varName),
69+
System.getenv(varName));
6770
}
6871

6972
@BeforeClass

healthcare/v1/src/test/java/snippets/healthcare/Hl7v2MessageTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ public class Hl7v2MessageTests {
6161

6262
private static void requireEnvVar(String varName) {
6363
assertNotNull(
64-
System.getenv(varName),
65-
String.format("Environment variable '%s' is required to perform these tests.", varName));
64+
String.format("Environment variable '%s' is required to perform these tests.", varName),
65+
System.getenv(varName));
6666
}
6767

6868
@BeforeClass

healthcare/v1/src/test/java/snippets/healthcare/Hl7v2StoreTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public class Hl7v2StoreTests {
5454

5555
private static void requireEnvVar(String varName) {
5656
assertNotNull(
57-
System.getenv(varName),
58-
String.format("Environment variable '%s' is required to perform these tests.", varName));
57+
String.format("Environment variable '%s' is required to perform these tests.", varName),
58+
System.getenv(varName));
5959
}
6060

6161
@BeforeClass

0 commit comments

Comments
 (0)