Skip to content

Commit

Permalink
fix: add test for mixed-cased field name
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenjudkins committed Oct 20, 2021
1 parent 374160b commit 7e602d9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Expand Up @@ -552,6 +552,24 @@ public void testNumericMismatch() throws Exception {
}
}

@Test public void testMixedCasedFieldNames() throws Exception {
TableFieldSchema field = TableFieldSchema
.newBuilder()
.setName("fooBar")
.setType(TableFieldSchema.Type.STRING)
.setMode(TableFieldSchema.Mode.NULLABLE)
.build();
TableSchema tableSchema = TableSchema.newBuilder().addFields(field).build();

JSONObject json = new JSONObject();
json.put("fooBar", "hello");

DynamicMessage protoMsg = JsonToProtoMessage.convertJsonToProtoMessage(
TestMixedCaseFieldNames.getDescriptor(), tableSchema, json
);

}

@Test
public void testBigNumericMismatch() throws Exception {
TableFieldSchema field =
Expand Down
4 changes: 4 additions & 0 deletions google-cloud-bigquerystorage/src/test/proto/jsonTest.proto
Expand Up @@ -156,3 +156,7 @@ message TestNumeric {
message TestBignumeric {
repeated bytes bignumeric = 1;
}

message TestMixedCaseFieldNames {
required string foobar = 1;
}

0 comments on commit 7e602d9

Please sign in to comment.