InMemoryMetaStore implements MetaStore { @Override public void createTable(Table table) { validateTableType(table); if (tables.containsKey(table.getName())) { throw new IllegalArgumentException("Duplicate table name: " + table.getName()); } providers.get(table.getType()).createTable(table); tables.put(table.getName(), table); }  @Override String getTableType(); @Override void createTable(Table table); @Override void dropTable(String tableName); @Override Map<String, Table> getTables(); @Override BeamSqlTable buildBeamSqlTable(Table table); @Override void registerProvider(TableProvider provider);  }
@Test public void testCreateTable() throws Exception { Table table = mockTable("person"); store.createTable(table); Table actualTable = store.getTables().get("person"); assertEquals(table, actualTable); }
@Test(expected = IllegalArgumentException.class) public void testCreateTable_invalidTableType() throws Exception { Table table = mockTable("person", "invalid"); store.createTable(table); }
@Test(expected = IllegalArgumentException.class) public void testCreateTable_duplicatedName() throws Exception { Table table = mockTable("person"); store.createTable(table); store.createTable(table); }