CsvToKeyValueMapper extends Mapper<LongWritable,Text,ImmutableBytesWritable,
        KeyValue> { @VisibleForTesting static String getJdbcUrl(Configuration conf) { String zkQuorum = conf.get(HConstants.ZOOKEEPER_QUORUM); if (zkQuorum == null) { throw new IllegalStateException(HConstants.ZOOKEEPER_QUORUM + " is not configured"); } return PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; }   static final String UPSERT_HOOK_CLASS_CONFKEY; static final String FIELD_DELIMITER_CONFKEY; static final String QUOTE_CHAR_CONFKEY; static final String ESCAPE_CHAR_CONFKEY; static final String ARRAY_DELIMITER_CONFKEY; static final String TABLE_NAME_CONFKEY; static final String INDEX_TABLE_NAME_CONFKEY; static final String COLUMN_INFO_CONFKEY; static final String IGNORE_INVALID_ROW_CONFKEY; }
@Test public void testGetJdbcUrl() { Configuration conf = new Configuration(); conf.set(HConstants.ZOOKEEPER_QUORUM, "myzkclient:2181"); String jdbcUrl = CsvToKeyValueMapper.getJdbcUrl(conf); assertEquals("jdbc:phoenix:myzkclient:2181", jdbcUrl); }
@Test(expected=IllegalStateException.class) public void testGetJdbcUrl_NotConfigured() { Configuration conf = new Configuration(); CsvToKeyValueMapper.getJdbcUrl(conf); }