From 71aa3323f8ac2f44cee73b773654ca76540dc5d3 Mon Sep 17 00:00:00 2001 From: Igor Berntein Date: Mon, 15 Jul 2024 14:21:31 -0400 Subject: [PATCH 1/2] test: fix samples test that was broken by a test harness change that was reliant on column family count. This PR fixes the test by making it focus on the family its trying to delete instead of the entire schema Change-Id: I0df90e68c0b25c4e66ed7d8ae1c19ae53577443b --- .../com/example/bigtable/deletes/DeletesTest.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/samples/snippets/src/test/java/com/example/bigtable/deletes/DeletesTest.java b/samples/snippets/src/test/java/com/example/bigtable/deletes/DeletesTest.java index a2fa31c0d6..308607c891 100644 --- a/samples/snippets/src/test/java/com/example/bigtable/deletes/DeletesTest.java +++ b/samples/snippets/src/test/java/com/example/bigtable/deletes/DeletesTest.java @@ -19,11 +19,13 @@ import com.example.bigtable.MobileTimeSeriesBaseTest; import com.google.api.gax.rpc.ServerStream; import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.models.ColumnFamily; import com.google.cloud.bigtable.data.v2.BigtableDataClient; import com.google.cloud.bigtable.data.v2.models.Query; import com.google.cloud.bigtable.data.v2.models.Row; import com.google.cloud.bigtable.data.v2.models.RowCell; import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.common.truth.Correspondence; import com.google.common.truth.Truth; import java.io.IOException; import java.util.List; @@ -39,6 +41,8 @@ */ @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class DeletesTest extends MobileTimeSeriesBaseTest { + private static final Correspondence COLUMN_FAMILY_ID_CORRESPONDENCE = + Correspondence.transforming(ColumnFamily::getId, "ColumnFamily id"); public static BigtableDataClient bigtableDataClient; @BeforeClass @@ -164,13 +168,17 @@ public void test6_testDeleteFromColumnFamily() throws IOException { public void test7_testDeleteColumnFamily() throws IOException { try (BigtableTableAdminClient tableAdminClient = BigtableTableAdminClient.create(projectId, instanceId)) { - Truth.assertThat(tableAdminClient.getTable(TABLE_ID).getColumnFamilies().size()).isEqualTo(2); + Truth.assertThat(tableAdminClient.getTable(TABLE_ID).getColumnFamilies()) + .comparingElementsUsing(COLUMN_FAMILY_ID_CORRESPONDENCE) + .contains(COLUMN_FAMILY_NAME_STATS); DeleteColumnFamilyExample deleteColumnFamilyExample = new DeleteColumnFamilyExample(); deleteColumnFamilyExample.deleteColumnFamily( projectId, instanceId, TABLE_ID, COLUMN_FAMILY_NAME_STATS); - Truth.assertThat(tableAdminClient.getTable(TABLE_ID).getColumnFamilies().size()).isEqualTo(1); + Truth.assertThat(tableAdminClient.getTable(TABLE_ID).getColumnFamilies()) + .comparingElementsUsing(COLUMN_FAMILY_ID_CORRESPONDENCE) + .doesNotContain(COLUMN_FAMILY_NAME_STATS); } } From 052067870cfe9d8d0153f0e7c0bb79beb53bbb4f Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 15 Jul 2024 18:27:16 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4d6e81feb8..6258c097c7 100644 --- a/README.md +++ b/README.md @@ -50,20 +50,20 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.42.0') +implementation platform('com.google.cloud:libraries-bom:26.43.0') implementation 'com.google.cloud:google-cloud-bigtable' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigtable:2.39.5' +implementation 'com.google.cloud:google-cloud-bigtable:2.40.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.39.5" +libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.40.0" ``` @@ -542,7 +542,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigtable/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigtable.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.39.5 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.40.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles