Skip to content

Commit 7c4b0af

Browse files
elisheva-qlogicigorbernstein2
authored andcommitted
---
yaml --- r: 15077 b: refs/heads/autosynth-bigquerydatatransfer c: 821bf93 h: refs/heads/master i: 15075: ce2a196
1 parent 45c04c8 commit 7c4b0af

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
@@ -124,7 +124,7 @@ refs/tags/v0.68.0: 9cc799fcf68c82ab431d425fefa58ef615ce8e5b
124124
refs/tags/v0.69.0: 78f67a29e8b9c46ba01de566a2eae0fd1c03edea
125125
refs/heads/autosynth-asset: cd8251de8c40e239ad24dcf9ed93ea2708a3eed5
126126
refs/heads/autosynth-automl: cced2f56bbef0499609073edbca6253e1df5e535
127-
refs/heads/autosynth-bigquerydatatransfer: 8ce9aef323f4c87af9f1cc013b9e568e32342330
127+
refs/heads/autosynth-bigquerydatatransfer: 821bf93dc663f0d249575f6117a4f3a0e121ae1d
128128
refs/heads/autosynth-bigquerystorage: 99aee05df348f39d98b6fb23c292006f1d2a6c28
129129
refs/heads/autosynth-bigtable: fa0d1de9e264d7ecac8a3abc3de7a8364cfaf427
130130
refs/heads/autosynth-bigtable-admin: 6379a2bc712f2736c83de0e009b4d26da4fa82ca

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