Skip to content

Commit 32deaaf

Browse files
elisheva-qlogicigorbernstein2
authored andcommitted
---
yaml --- r: 15825 b: refs/heads/autosynth-dialogflow c: 821bf93 h: refs/heads/master i: 15823: e4010ab
1 parent ee0c741 commit 32deaaf

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
@@ -130,7 +130,7 @@ refs/heads/autosynth-bigtable: 2fbcb15847e0e89e79d6dc07420e28d7dfcea894
130130
refs/heads/autosynth-bigtable-admin: 6379a2bc712f2736c83de0e009b4d26da4fa82ca
131131
refs/heads/autosynth-containeranalysis: 039ca5b8db725c76c16a965ff26b2774322b8ef8
132132
refs/heads/autosynth-datastore: 9acd400b484d6691a080c9152a331d88d24fefc1
133-
refs/heads/autosynth-dialogflow: 8ce9aef323f4c87af9f1cc013b9e568e32342330
133+
refs/heads/autosynth-dialogflow: 821bf93dc663f0d249575f6117a4f3a0e121ae1d
134134
refs/heads/autosynth-errorreporting: 3d0566d6bebcc187f148bbed463b5a8e75b1edf6
135135
refs/heads/autosynth-firestore: 92b27fbc8855c9902168695abb0a8f1f433b750b
136136
refs/heads/autosynth-iot: 9d732be07d99843d8cb53d34ec0837328a807fce

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