hehuiyuan commented on pull request #15274:
URL: https://github.com/apache/flink/pull/15274#issuecomment-806426821
> > > HiveCatalogFactoryTest
> >
> >
> > Hi @lirui-apache , is it ok?
> > `
> > ```
> > @Test
> > public void testCreateHiveCatalogWithIllegalHadoopConfDir() throws
IOException {
> > final String catalogName = "mycatalog";
> >
> > final String illegalHadoopConfDir = " " +
tempFolder.newFolder().getAbsolutePath();
> >
> > try {
> > final HiveCatalog hiveCatalog =
> > HiveTestUtils.createHiveCatalog(
> > catalogName, CONF_DIR.getPath(),
illegalHadoopConfDir, null);
> > } catch (Exception e) {
> > assertEquals(e.getClass(), CatalogException.class);
> > }
> > }
> > ```
> >
> >
> > `
>
> Hi @hehuiyuan , two suggestions about the test:
>
> 1. You should create the HiveCatalog with `HiveCatalogFactory` like other
test cases in this class. It's because we should verify the behavior of
`HiveCatalogFactory`, rather than `HiveTestUtils`.
> 2. Instead of catching all exceptions and assert it's a
`CatalogException`, you can just catch `CatalogException` only.
--
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:
[email protected]