Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Commit 9d83ed7

Browse files
committed
added files
1 parent fa1376d commit 9d83ed7

9 files changed

Lines changed: 103 additions & 32 deletions

File tree

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateSchemaBundleRequest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
import com.google.protobuf.ByteString;
2525
import java.io.IOException;
2626
import java.nio.file.Files;
27-
import java.nio.file.Path;
2827
import java.nio.file.Paths;
29-
3028
import javax.annotation.Nonnull;
3129

3230
/**

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateSchemaBundleRequest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626
import com.google.protobuf.util.FieldMaskUtil;
2727
import java.io.IOException;
2828
import java.nio.file.Files;
29-
import java.nio.file.Path;
3029
import java.nio.file.Paths;
31-
3230
import javax.annotation.Nonnull;
3331

3432
/**

google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClientTests.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ public class BigtableTableAdminClientTests {
133133
private static final String BACKUP_ID = "my-backup";
134134
private static final String AUTHORIZED_VIEW_ID = "my-authorized-view";
135135
private static final String SCHEMA_BUNDLE_ID = "my-schema-bundle";
136+
// Location: `google-cloud-bigtable/src/test/resources/proto_schema_bundle.pb`
137+
private static final String TEST_PROTO_SCHEMA_BUNDLE = "proto_schema_bundle.pb";
138+
// Location: `google-cloud-bigtable/src/test/resources/updated_proto_schema_bundle.pb`
139+
private static final String TEST_UPDATED_PROTO_SCHEMA_BUNDLE = "updated_proto_schema_bundle.pb";
136140

137141
private static final String INSTANCE_NAME = NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID);
138142
private static final String TABLE_NAME =
@@ -1367,7 +1371,7 @@ public void testCreateSchemaBundle() throws IOException {
13671371
.build());
13681372

13691373
CreateSchemaBundleRequest req =
1370-
CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID).setProtoSchema("file.pb");
1374+
CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID).setProtoSchema(TEST_PROTO_SCHEMA_BUNDLE);
13711375

13721376
// Execute
13731377
SchemaBundle actualResult = adminClient.createSchemaBundle(req);
@@ -1415,7 +1419,7 @@ public void testUpdateSchemaBundle() throws IOException {
14151419
.build());
14161420

14171421
UpdateSchemaBundleRequest req =
1418-
UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID).setProtoSchema("updated_file.pb");
1422+
UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID).setProtoSchema(TEST_UPDATED_PROTO_SCHEMA_BUNDLE);
14191423

14201424
// Execute
14211425
SchemaBundle actualResult = adminClient.updateSchemaBundle(req);

google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateSchemaBundleRequestTest.java

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@
1818

1919
import static com.google.common.truth.Truth.assertThat;
2020

21-
import java.io.IOException;
22-
2321
import com.google.cloud.bigtable.admin.v2.internal.NameUtil;
2422
import com.google.protobuf.ByteString;
23+
import java.io.IOException;
2524
import org.junit.Test;
2625
import org.junit.runner.RunWith;
2726
import org.junit.runners.JUnit4;
@@ -32,11 +31,16 @@ public class CreateSchemaBundleRequestTest {
3231
private static final String INSTANCE_ID = "my-instance";
3332
private static final String TABLE_ID = "my-table";
3433
private static final String SCHEMA_BUNDLE_ID = "my-schema-bundle";
34+
// Location: `google-cloud-bigtable/src/test/resources/proto_schema_bundle.pb`
35+
private static final String TEST_PROTO_SCHEMA_BUNDLE = "proto_schema_bundle.pb";
36+
// Location: `google-cloud-bigtable/src/test/resources/updated_proto_schema_bundle.pb`
37+
private static final String TEST_UPDATED_PROTO_SCHEMA_BUNDLE = "updated_proto_schema_bundle.pb";
3538

3639
@Test
37-
public void testToProto() throws IOException{
40+
public void testToProto() throws IOException {
3841
CreateSchemaBundleRequest request =
39-
CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID).setProtoSchema("file.pb");
42+
CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID)
43+
.setProtoSchema(TEST_PROTO_SCHEMA_BUNDLE);
4044

4145
com.google.bigtable.admin.v2.CreateSchemaBundleRequest requestProto =
4246
com.google.bigtable.admin.v2.CreateSchemaBundleRequest.newBuilder()
@@ -54,35 +58,38 @@ public void testToProto() throws IOException{
5458
}
5559

5660
@Test
57-
public void testEquality() throws IOException{
61+
public void testEquality() throws IOException {
5862
CreateSchemaBundleRequest request =
59-
CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID).setProtoSchema("file.pb");
63+
CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID)
64+
.setProtoSchema(TEST_PROTO_SCHEMA_BUNDLE);
6065

6166
assertThat(request)
6267
.isEqualTo(
63-
CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID).setProtoSchema("file.pb"));
68+
CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID)
69+
.setProtoSchema(TEST_PROTO_SCHEMA_BUNDLE));
6470

6571
assertThat(request)
6672
.isNotEqualTo(
6773
CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID)
68-
.setProtoSchema("updated_file.pb"));
74+
.setProtoSchema(TEST_UPDATED_PROTO_SCHEMA_BUNDLE));
6975
}
7076

7177
@Test
72-
public void testHashCode() throws IOException{
78+
public void testHashCode() throws IOException {
7379
CreateSchemaBundleRequest request =
74-
CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID).setProtoSchema("file.pb");
80+
CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID)
81+
.setProtoSchema(TEST_PROTO_SCHEMA_BUNDLE);
7582

7683
assertThat(request.hashCode())
7784
.isEqualTo(
7885
CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID)
79-
.setProtoSchema("file.pb")
86+
.setProtoSchema(TEST_PROTO_SCHEMA_BUNDLE)
8087
.hashCode());
8188

8289
assertThat(request.hashCode())
8390
.isNotEqualTo(
8491
CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID)
85-
.setProtoSchema("updated_file.pb")
92+
.setProtoSchema(TEST_UPDATED_PROTO_SCHEMA_BUNDLE)
8693
.hashCode());
8794
}
8895
}

google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateSchemaBundleRequestTest.java

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@
1818

1919
import static com.google.common.truth.Truth.assertThat;
2020

21-
import java.io.IOException;
22-
2321
import com.google.cloud.bigtable.admin.v2.internal.NameUtil;
2422
import com.google.protobuf.ByteString;
2523
import com.google.protobuf.FieldMask;
24+
import java.io.IOException;
2625
import org.junit.Test;
2726
import org.junit.runner.RunWith;
2827
import org.junit.runners.JUnit4;
@@ -33,12 +32,16 @@ public class UpdateSchemaBundleRequestTest {
3332
private static final String INSTANCE_ID = "my-instance";
3433
private static final String TABLE_ID = "my-table";
3534
private static final String SCHEMA_BUNDLE_ID = "my-schema-bundle";
35+
// Location: `google-cloud-bigtable/src/test/resources/proto_schema_bundle.pb`
36+
private static final String TEST_PROTO_SCHEMA_BUNDLE = "proto_schema_bundle.pb";
37+
// Location: `google-cloud-bigtable/src/test/resources/updated_proto_schema_bundle.pb`
38+
private static final String TEST_UPDATED_PROTO_SCHEMA_BUNDLE = "updated_proto_schema_bundle.pb";
3639

3740
@Test
38-
public void testToProto() throws IOException{
41+
public void testToProto() throws IOException {
3942
UpdateSchemaBundleRequest request =
4043
UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID)
41-
.setProtoSchema("file.pb")
44+
.setProtoSchema(TEST_PROTO_SCHEMA_BUNDLE)
4245
.setIgnoreWarnings(true);
4346

4447
com.google.bigtable.admin.v2.UpdateSchemaBundleRequest requestProto =
@@ -60,7 +63,7 @@ public void testToProto() throws IOException{
6063
}
6164

6265
@Test
63-
public void testUpdateProtoSchema() throws IOException{
66+
public void testUpdateProtoSchema() throws IOException {
6467
com.google.bigtable.admin.v2.SchemaBundle existingSchemaBundle =
6568
com.google.bigtable.admin.v2.SchemaBundle.newBuilder()
6669
.setName(
@@ -74,7 +77,7 @@ public void testUpdateProtoSchema() throws IOException{
7477

7578
UpdateSchemaBundleRequest request =
7679
UpdateSchemaBundleRequest.of(SchemaBundle.fromProto(existingSchemaBundle))
77-
.setProtoSchema("updated_file.pb");
80+
.setProtoSchema(TEST_UPDATED_PROTO_SCHEMA_BUNDLE);
7881

7982
com.google.bigtable.admin.v2.UpdateSchemaBundleRequest requestProto =
8083
com.google.bigtable.admin.v2.UpdateSchemaBundleRequest.newBuilder()
@@ -85,35 +88,38 @@ public void testUpdateProtoSchema() throws IOException{
8588
}
8689

8790
@Test
88-
public void testEquality() throws IOException{
91+
public void testEquality() throws IOException {
8992
UpdateSchemaBundleRequest request =
90-
UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID).setProtoSchema("file.pb");
93+
UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID)
94+
.setProtoSchema(TEST_PROTO_SCHEMA_BUNDLE);
9195

9296
assertThat(request)
9397
.isEqualTo(
94-
UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID).setProtoSchema("file.pb"));
98+
UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID)
99+
.setProtoSchema(TEST_PROTO_SCHEMA_BUNDLE));
95100

96101
assertThat(request)
97102
.isNotEqualTo(
98103
UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID)
99-
.setProtoSchema("updated_file.pb"));
104+
.setProtoSchema(TEST_UPDATED_PROTO_SCHEMA_BUNDLE));
100105
}
101106

102107
@Test
103-
public void testHashCode() throws IOException{
108+
public void testHashCode() throws IOException {
104109
UpdateSchemaBundleRequest request =
105-
UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID).setProtoSchema("file.pb");
110+
UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID)
111+
.setProtoSchema(TEST_PROTO_SCHEMA_BUNDLE);
106112

107113
assertThat(request.hashCode())
108114
.isEqualTo(
109115
UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID)
110-
.setProtoSchema("file.pb")
116+
.setProtoSchema(TEST_PROTO_SCHEMA_BUNDLE)
111117
.hashCode());
112118

113119
assertThat(request.hashCode())
114120
.isNotEqualTo(
115121
UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID)
116-
.setProtoSchema("updated_file.pb")
122+
.setProtoSchema(TEST_UPDATED_PROTO_SCHEMA_BUNDLE)
117123
.hashCode());
118124
}
119125
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
q
3+
proto_schema_bundle.proto#gcloud.bigtable.schema_bundles.test"'
4+
Author
5+
6+
first_name ( R firstNamebproto3
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
Copyright 2025 Google LLC
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
13+
// The `proto_schema_bundle.pb` binary is generated from this source file, via command:
14+
// protoc --include_imports --descriptor_set_out=proto_schema_bundle.pb proto_schema_bundle.proto
15+
16+
syntax = "proto3";
17+
18+
package gcloud.bigtable.schema_bundles.test;
19+
20+
message Author {
21+
string first_name = 1;
22+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
�
3+
!updated_proto_schema_bundle.proto#gcloud.bigtable.schema_bundles.test"D
4+
Author
5+
6+
first_name ( R firstName
7+
last_name ( RlastNamebproto3
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
Copyright 2025 Google LLC
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
13+
// The `updated_proto_schema_bundle.pb` binary is generated from this source file, via command:
14+
// protoc --include_imports --descriptor_set_out=updated_proto_schema_bundle.pb updated_proto_schema_bundle.proto
15+
16+
syntax = "proto3";
17+
18+
package gcloud.bigtable.schema_bundles.test;
19+
20+
message Author {
21+
string first_name = 1;
22+
string last_name = 2;
23+
}

0 commit comments

Comments
 (0)