@Test
public void testDefaults() throws Exception {

    IndexerComponentFactory factory = IndexerComponentFactoryUtil.getComponentFactory(impl, getClass().getResourceAsStream("indexerconf_defaults.xml"), Maps.<String, String>newHashMap());
    IndexerConf conf = factory.createIndexerConf();
    assertEquals("table1", conf.getTable());
    assertEquals(IndexerConf.DEFAULT_MAPPING_TYPE, conf.getMappingType());
    assertEquals(IndexerConf.DEFAULT_ROW_READ_MODE, conf.getRowReadMode());
    assertEquals(IndexerConf.DEFAULT_UNIQUE_KEY_FIELD, conf.getUniqueKeyField());
    assertNull(conf.getRowField());
    assertNull(conf.getColumnFamilyField());
    assertNull(conf.getTableNameField());
    assertEquals(IndexerConf.DEFAULT_UNIQUE_KEY_FORMATTER, conf.getUniqueKeyFormatterClass());
    assertEquals(DefaultResultToSolrMapper.class, conf.getMapperClass());
    List<FieldDefinition> fieldDefs = conf.getFieldDefinitions();
    List<FieldDefinition> expectedFieldDefs = Lists.newArrayList(
            new FieldDefinition("field1", "col:qual1", IndexerConf.DEFAULT_VALUE_SOURCE, IndexerConf.DEFAULT_FIELD_TYPE));
    assertEquals(expectedFieldDefs, fieldDefs);
    List<DocumentExtractDefinition> extractDefs = conf.getDocumentExtractDefinitions();
    List<DocumentExtractDefinition> expectedExtractDefs = Lists.newArrayList(
            new DocumentExtractDefinition(null, "col:qual2", ValueSource.VALUE, "application/octet-stream"));
    assertEquals(expectedExtractDefs, extractDefs);
}