@Test
public void testGetSchemaFromString() {

  // Set fields schema for testing.
  String fields =
      "[{'name': 'MyName', 'type': 'STRING'},"
      + "{'name': 'Number', 'type': 'INTEGER', 'mode': 'sample'}]";
  List<TableFieldSchema> list = BigQueryUtils.getSchemaFromString(fields);
  assertThat(list).hasSize(2);
  assertThat(list.get(0).getName()).isEqualTo("MyName");
  assertThat(list.get(0).getType()).isEqualTo("STRING");
  assertThat(list.get(1).getName()).isEqualTo("Number");
  assertThat(list.get(1).getType()).isEqualTo("INTEGER");
  assertThat(list.get(1).getMode()).isEqualTo("sample");
}