Skip to content

Commit 6d3c502

Browse files
elisheva-qlogicigorbernstein2
authored andcommitted
---
yaml --- r: 15217 b: refs/heads/autosynth-bigtable c: 821bf93 h: refs/heads/master i: 15215: 820edb8
1 parent 20de9f3 commit 6d3c502

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
@@ -126,7 +126,7 @@ refs/heads/autosynth-asset: cd8251de8c40e239ad24dcf9ed93ea2708a3eed5
126126
refs/heads/autosynth-automl: cced2f56bbef0499609073edbca6253e1df5e535
127127
refs/heads/autosynth-bigquerydatatransfer: a6667617707608b1dbfb02d59c22b5152f208da7
128128
refs/heads/autosynth-bigquerystorage: 14ab055598b943ae3f33f484e9fb1653355d08e7
129-
refs/heads/autosynth-bigtable: 8ce9aef323f4c87af9f1cc013b9e568e32342330
129+
refs/heads/autosynth-bigtable: 821bf93dc663f0d249575f6117a4f3a0e121ae1d
130130
refs/heads/autosynth-bigtable-admin: 6379a2bc712f2736c83de0e009b4d26da4fa82ca
131131
refs/heads/autosynth-containeranalysis: 781fdb430a60f9a6491f116e31e4e10118157bdb
132132
refs/heads/autosynth-datastore: af1fb76aa3eee02fe6f31f8fa1c72a4f048d149b

branches/autosynth-bigtable/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)