Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix samples test that was broken by a test harness change #2284

Merged
merged 2 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```
<!-- {x-version-update-end} -->

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -39,6 +41,8 @@
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class DeletesTest extends MobileTimeSeriesBaseTest {
private static final Correspondence<ColumnFamily, String> COLUMN_FAMILY_ID_CORRESPONDENCE =
Correspondence.transforming(ColumnFamily::getId, "ColumnFamily id");
public static BigtableDataClient bigtableDataClient;

@BeforeClass
Expand Down Expand Up @@ -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);
}
}

Expand Down
Loading