### Question:
Catalogs { public static Table loadTable(Configuration conf) { return loadTable(conf, conf.get(InputFormatConfig.TABLE_IDENTIFIER), conf.get(InputFormatConfig.TABLE_LOCATION)); } private  Catalogs(); static Table loadTable(Configuration conf); static Table loadTable(Configuration conf, Properties props);  }### Answer:
@Test public void testLoadTableFromLocation() throws IOException { AssertHelpers.assertThrows( "Should complain about table location not set", IllegalArgumentException.class, "location not set", () -> Catalogs.loadTable(conf)); HadoopTables tables = new HadoopTables(); Table hadoopTable = tables.create(SCHEMA, temp.newFolder("hadoop_tables").toString()); conf.set(InputFormatConfig.TABLE_LOCATION, hadoopTable.location()); Assert.assertEquals(hadoopTable.location(), Catalogs.loadTable(conf).location()); }
@Test public void testLoadTableFromCatalog() throws IOException { conf.set("warehouse.location", temp.newFolder("hadoop", "warehouse").toString()); conf.setClass(InputFormatConfig.CATALOG_LOADER_CLASS, CustomHadoopCatalogLoader.class, CatalogLoader.class); AssertHelpers.assertThrows( "Should complain about table identifier not set", IllegalArgumentException.class, "identifier not set", () -> Catalogs.loadTable(conf)); HadoopCatalog catalog = new CustomHadoopCatalog(conf); Table hadoopCatalogTable = catalog.createTable(TableIdentifier.of("table"), SCHEMA); conf.set(InputFormatConfig.TABLE_IDENTIFIER, "table"); Assert.assertEquals(hadoopCatalogTable.location(), Catalogs.loadTable(conf).location()); }