xuefuz commented on a change in pull request #8541: [FLINK-9172][sql-client] Support catalogs in SQL-Client yaml config file URL: https://github.com/apache/flink/pull/8541#discussion_r287918350
########## File path: flink-table/flink-sql-client/src/test/java/org/apache/flink/table/client/gateway/local/EnvironmentTest.java ########## @@ -70,4 +79,24 @@ public void testMerging() throws Exception { assertTrue(merged.getExecution().isStreamingExecution()); assertEquals(16, merged.getExecution().getMaxParallelism()); } + + @Test + public void testDuplicateCatalog() { + exception.expect(SqlClientException.class); + exception.expectMessage("Cannot create catalog 'catalog2' because a catalog with this name is already registered."); + Environment env = new Environment(); + env.setCatalogs(Arrays.asList( + getCatalog("catalog1", "test"), + getCatalog("catalog2", "test"), + getCatalog("catalog2", "test"))); + } + + private static Map<String, Object> getCatalog(String name, String type) { Review comment: rename to createCatalog or instantiateCatalog? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services