Skip to content

Commit d3a648a

Browse files
elisheva-qlogicigorbernstein2
authored andcommitted
---
yaml --- r: 13559 b: refs/heads/autosynth-dlp c: 821bf93 h: refs/heads/master i: 13557: 3027864 13555: 8641f2f 13551: f1a8e7d
1 parent 67a351c commit d3a648a

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ refs/tags/v0.60.0: 4cd518d0612329f8a8e53484eef4cd1651e32855
104104
refs/tags/v0.61.0: e4b526656bb1bf5eefd0ee578b7405147821225e
105105
refs/tags/v0.62.0: bbede7385d48ba08f487bdd29ec10668ace96396
106106
refs/heads/0.60.0-alpha: 10939381ffe0b8da32db4fe3087c86e3aa7f3e55
107-
refs/heads/autosynth-dlp: 8ce9aef323f4c87af9f1cc013b9e568e32342330
107+
refs/heads/autosynth-dlp: 821bf93dc663f0d249575f6117a4f3a0e121ae1d
108108
refs/heads/autosynth-logging: f8794c50a64f62b167cddf42513d133547679e01
109109
refs/heads/dupes: 3478c5d81fd242d0e985656645a679420a2060c2
110110
refs/tags/v0.63.0: 94f19b71d40f46b36120e7b9d78a1a3d41bfcbd6

branches/autosynth-dlp/google-cloud-examples/src/test/java/com/google/cloud/examples/bigtable/ITInstanceAdminExample.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import static org.junit.Assert.assertTrue;
2121

2222
import com.google.api.gax.rpc.NotFoundException;
23-
import com.google.bigtable.admin.v2.InstanceName;
2423
import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminClient;
2524
import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminSettings;
2625
import com.google.cloud.bigtable.admin.v2.models.Cluster;
@@ -42,25 +41,24 @@
4241
/** Integration tests for {@link InstanceAdminExample} */
4342
public class ITInstanceAdminExample {
4443

45-
private static final String INSTANCE_PROPERTY_NAME = "bigtable.instance";
44+
private static final String PROJECT_PROPERTY_NAME = "bigtable.project";
4645
private static final String ID_PREFIX = "instanceadmin";
4746
private static final String CLUSTER = "cluster";
48-
private static String projectName;
47+
private static String projectId;
4948
private static BigtableInstanceAdminClient adminClient;
5049
private String clusterId;
5150
private String instanceId;
5251
private InstanceAdminExample instanceAdmin;
5352

5453
@BeforeClass
5554
public static void beforeClass() throws IOException {
56-
String targetProject = System.getProperty(INSTANCE_PROPERTY_NAME);
57-
if (targetProject == null) {
55+
projectId = System.getProperty(PROJECT_PROPERTY_NAME);
56+
if (projectId == null) {
5857
adminClient = null;
5958
return;
6059
}
61-
projectName = InstanceName.parse(targetProject).getProject();
6260
BigtableInstanceAdminSettings instanceAdminSettings =
63-
BigtableInstanceAdminSettings.newBuilder().setProjectId(projectName).build();
61+
BigtableInstanceAdminSettings.newBuilder().setProjectId(projectId).build();
6462
adminClient = BigtableInstanceAdminClient.create(instanceAdminSettings);
6563
}
6664

@@ -74,11 +72,11 @@ public static void afterClass() {
7472
public void setup() throws IOException {
7573
if (adminClient == null) {
7674
throw new AssumptionViolatedException(
77-
INSTANCE_PROPERTY_NAME + " property is not set, skipping integration tests.");
75+
PROJECT_PROPERTY_NAME + " property is not set, skipping integration tests.");
7876
}
7977
instanceId = generateId();
8078
clusterId = generateId();
81-
instanceAdmin = new InstanceAdminExample(projectName, instanceId, clusterId);
79+
instanceAdmin = new InstanceAdminExample(projectId, instanceId, clusterId);
8280
adminClient.createInstance(
8381
CreateInstanceRequest.of(instanceId)
8482
.addCluster(clusterId, "us-central1-f", 3, StorageType.SSD)
@@ -99,7 +97,7 @@ public void testCreateAndDeleteInstance() throws IOException {
9997
String testInstance = generateId();
10098
String testCluster = generateId();
10199
InstanceAdminExample testInstanceAdmin =
102-
new InstanceAdminExample(projectName, testInstance, testCluster);
100+
new InstanceAdminExample(projectId, testInstance, testCluster);
103101
testInstanceAdmin.createProdInstance();
104102
assertTrue(adminClient.exists(testInstance));
105103

0 commit comments

Comments
 (0)