public void testSchemaWithNestedFields() {
BigQuerySchemaMarshallerTester<Person> tester = new BigQuerySchemaMarshallerTester<Person>(
new BigQueryMarshallerByType<Person>(Person.class));
TableFieldSchema f1 = new TableFieldSchema().setType("integer").setName("age")
.setMode(BigQueryFieldMode.REQUIRED.getValue());
TableFieldSchema f2 = new TableFieldSchema().setType("float").setName("height")
.setMode(BigQueryFieldMode.REQUIRED.getValue());
TableFieldSchema f3 = new TableFieldSchema().setType("float").setName("weight")
.setMode(BigQueryFieldMode.REQUIRED.getValue());
TableFieldSchema f4 = new TableFieldSchema().setType("string").setName("gender");
TableFieldSchema f5 = new TableFieldSchema().setType("record").setName("gender");
TableFieldSchema f51 = new TableFieldSchema().setType("integer").setName("number")
.setMode(BigQueryFieldMode.REQUIRED.getValue());
TableFieldSchema f52 = new TableFieldSchema().setType("integer").setName("areaCode")
.setMode(BigQueryFieldMode.REQUIRED.getValue());
tester.testSchema(new TableSchema().setFields(
Lists.newArrayList(new TableFieldSchema().setType("string").setName("fullName"),
f1,
f2,
f3,
f4,
f5.setFields(Lists.newArrayList(f51, f52)))));