Skip to content
Permalink
Browse files
fix: change clusterId in Cmek test (#716)
* fix: change clusterId in Cmek test

Change-Id: Idc8ad885205190374b089349ee94cc627bafd782

* refactor: add some logging

Change-Id: I8d0ce18de5fa8e914344340850786930fbd670f1
  • Loading branch information
ad548 committed Apr 9, 2021
1 parent dfc2efd commit 67ef15591d49d51728c769eb54a1167b15524aa1
Showing with 6 additions and 1 deletion.
  1. +6 −1 google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableCmekIT.java
@@ -70,6 +70,7 @@ public class BigtableCmekIT {
private static String instanceId;
private static String clusterId1;
private static String clusterId2;
private static String clusterId3;
private static String kmsKeyName;
private static List<String> zones;
private static String otherZone;
@@ -91,6 +92,7 @@ public static void validatePlatform() throws IOException {
instanceId = AbstractTestEnv.TEST_INSTANCE_PREFIX + Instant.now().getEpochSecond();
clusterId1 = instanceId + "-c1";
clusterId2 = instanceId + "-c2";
clusterId3 = instanceId + "-c3";
zones = testEnvRule.env().getMultipleZonesInSameRegion();
otherZone =
Sets.difference(
@@ -110,6 +112,7 @@ public static void validatePlatform() throws IOException {
.setInstanceId(instanceId)
.build());

LOGGER.info("Creating cluster in zone: " + zones.get(0));
instanceAdmin.createInstance(
CreateInstanceRequest.of(instanceId)
.addCmekCluster(clusterId1, zones.get(0), 1, StorageType.SSD, kmsKeyName));
@@ -137,6 +140,7 @@ public void instanceAndClusterTest() {
Cluster cluster = instanceAdmin.getCluster(instanceId, clusterId1);
assertThat(cluster.getKmsKeyName()).isEqualTo(kmsKeyName);

LOGGER.info("Creating cluster in zone: " + zones.get(1));
instanceAdmin.createCluster(
CreateClusterRequest.of(instanceId, clusterId2)
.setZone(zones.get(1))
@@ -147,9 +151,10 @@ public void instanceAndClusterTest() {
Cluster secondCluster = instanceAdmin.getCluster(instanceId, clusterId2);
assertThat(secondCluster.getKmsKeyName()).isEqualTo(kmsKeyName);

LOGGER.info("Trying to create cluster in zone: " + otherZone);
try {
instanceAdmin.createCluster(
CreateClusterRequest.of(instanceId, clusterId2)
CreateClusterRequest.of(instanceId, clusterId3)
.setZone(otherZone)
.setServeNodes(1)
.setStorageType(StorageType.SSD)

0 comments on commit 67ef155

Please sign in to comment.