@Inject public JdbcMetadataFactory(JdbcClient jdbcClient, JdbcMetadataConfig config) { this.jdbcClient = requireNonNull(jdbcClient, "jdbcClient is null"); requireNonNull(config, "config is null"); this.allowDropTable = config.isAllowDropTable(); }
@Test public void testExplicitPropertyMappings() { Map<String, String> properties = new ImmutableMap.Builder<String, String>() .put("allow-drop-table", "true") .build(); JdbcMetadataConfig expected = new JdbcMetadataConfig() .setAllowDropTable(true); assertFullMapping(properties, expected); } }
@Test public void testDefaults() { assertRecordedDefaults(recordDefaults(JdbcMetadataConfig.class) .setAllowDropTable(false)); }
@Test public void testDefaults() { assertRecordedDefaults(recordDefaults(JdbcMetadataConfig.class) .setAllowDropTable(false)); }
@Inject public JdbcMetadata(JdbcConnectorId connectorId, JdbcClient jdbcClient, JdbcMetadataConfig config) { this.jdbcClient = requireNonNull(jdbcClient, "client is null"); requireNonNull(config, "config is null"); allowDropTable = config.isAllowDropTable(); }
@Test public void testExplicitPropertyMappings() { Map<String, String> properties = new ImmutableMap.Builder<String, String>() .put("allow-drop-table", "true") .build(); JdbcMetadataConfig expected = new JdbcMetadataConfig() .setAllowDropTable(true); assertFullMapping(properties, expected); } }