@Test
public void testGetSchemaFromStringWithTopLevelNonJsonObject() {

  // Bad schema, missing 'type' in the second entry.
  String fields =
      "[{'name': 'MyName', 'type': 'STRING'},"
      + "foo,"
      + "{'name': 'Number', 'type': 'INTEGER', 'mode': 'sample'}]";
  assertThrows(IllegalArgumentException.class, () -> BigQueryUtils.getSchemaFromString(fields));
}