Source:
public void testJdbcValidation() { try { Map<String, String> properties = getBasicProperties(); properties.put("connector.password", "pass"); TableFactoryService.find(StreamTableSourceFactory.class, properties) .createStreamTableSource(properties); fail("exception expected"); } catch (IllegalArgumentException ignored) { } try { Map<String, String> properties = getBasicProperties(); properties.put("connector.read.partition.column", "aaa"); properties.put("connector.read.partition.lower-bound", "-10"); properties.put("connector.read.partition.upper-bound", "100"); TableFactoryService.find(StreamTableSourceFactory.class, properties) .createStreamTableSource(properties); fail("exception expected"); } catch (IllegalArgumentException ignored) { } try { Map<String, String> properties = getBasicProperties(); properties.put("connector.read.partition.column", "aaa"); properties.put("connector.read.partition.lower-bound", "100"); properties.put("connector.read.partition.upper-bound", "-10"); properties.put("connector.read.partition.num", "10"); TableFactoryService.find(StreamTableSourceFactory.class, properties) .createStreamTableSource(properties); fail("exception expected"); } catch (IllegalArgumentException ignored) { } try { Map<String, String> properties = getBasicProperties(); properties.put("connector.lookup.cache.max-rows", "10"); TableFactoryService.find(StreamTableSourceFactory.class, properties) .createStreamTableSource(properties); fail("exception expected"); } catch (IllegalArgumentException ignored) { } try { Map<String, String> properties = getBasicProperties(); properties.put("connector.lookup.cache.ttl", "1s"); TableFactoryService.find(StreamTableSourceFactory.class, properties) .createStreamTableSource(properties); fail("exception expected"); } catch (IllegalArgumentException ignored) { } try { Map<String, String> properties = getBasicProperties(); properties.put("connector.lookup.max-retries", "0"); TableFactoryService.find(StreamTableSourceFactory.class, properties) .createStreamTableSource(properties); fail("exception expected"); } catch (Throwable ignored) { } }

Target:
public void testJdbcValidation() { try { Map<String, String> properties = getBasicProperties(); properties.put("connector.password", "pass"); TableFactoryService.find(StreamTableSourceFactory.class, properties) .createStreamTableSource(properties); fail("exception expected"); } catch (IllegalArgumentException ignored) { } try { Map<String, String> properties = getBasicProperties(); properties.put("connector.read.partition.column", "aaa"); properties.put("connector.read.partition.lower-bound", "-10"); properties.put("connector.read.partition.upper-bound", "100"); TableFactoryService.find(StreamTableSourceFactory.class, properties) .createStreamTableSource(properties); fail("exception expected"); } catch (IllegalArgumentException ignored) { } try { Map<String, String> properties = getBasicProperties(); properties.put("connector.read.partition.column", "aaa"); properties.put("connector.read.partition.lower-bound", "100"); properties.put("connector.read.partition.upper-bound", "-10"); properties.put("connector.read.partition.num", "10"); TableFactoryService.find(StreamTableSourceFactory.class, properties) .createStreamTableSource(properties); fail("exception expected"); } catch (IllegalArgumentException ignored) { } try { Map<String, String> properties = getBasicProperties(); properties.put("connector.lookup.cache.max-rows", "10"); TableFactoryService.find(StreamTableSourceFactory.class, properties) .createStreamTableSource(properties); fail("exception expected"); } catch (IllegalArgumentException ignored) { } try { Map<String, String> properties = getBasicProperties(); properties.put("connector.lookup.cache.ttl", "1s"); TableFactoryService.find(StreamTableSourceFactory.class, properties) .createStreamTableSource(properties); fail("exception expected"); } catch (IllegalArgumentException ignored) { } try { Map<String, String> properties = getBasicProperties(); properties.put("connector.lookup.max-retries", "-1"); TableFactoryService.find(StreamTableSourceFactory.class, properties) .createStreamTableSource(properties); fail("exception expected"); } catch (ValidationException ignored) { } }