### Question:
DateIndexTableConfigHelper extends AbstractTableConfigHelper { @Override public void setup(String tableName, Configuration config, Logger log) throws IllegalArgumentException { this.log = log; this.conf = config; this.tableName = tableName; if (this.tableName == null) { throw new IllegalArgumentException("No DateIndex Table Defined"); } String localityGroupsConf = null; localityGroupsConf = conf.get(LOCALITY_GROUPS, ExtendedDataTypeHandler.FULL_CONTENT_LOCALITY_NAME + ':' + ExtendedDataTypeHandler.FULL_CONTENT_COLUMN_FAMILY + ',' + ExtendedDataTypeHandler.TERM_FREQUENCY_LOCALITY_NAME + ':' + ExtendedDataTypeHandler.TERM_FREQUENCY_COLUMN_FAMILY); for (String localityGroupDefConf : StringUtils.split(localityGroupsConf)) { String[] localityGroupDef = StringUtils.split(localityGroupDefConf, '\\', ':'); Set<Text> families = localityGroups.get(localityGroupDef[0]); if (families == null) { families = new HashSet<>(); localityGroups.put(localityGroupDef[0], families); } families.add(new Text(localityGroupDef[1])); } }  @Override void setup(String tableName, Configuration config, Logger log); @Override void configure(TableOperations tops); static final String LOCALITY_GROUPS; }### Answer:
@Test public void testSetupNothingDefinedInConfiguration() { DateIndexTableConfigHelperTest.logger.info("DateIndexTableConfigHelperTest.testSetupNothingDefinedInConfiguration called."); try { DateIndexTableConfigHelper uut = new DateIndexTableConfigHelper(); Configuration config = this.createMockConfiguration(); Logger log = this.createMockLogger(); uut.setup(DateIndexTableConfigHelperTest.TABLE_NAME, config, log); } catch (IllegalArgumentException iae) { String msg = iae.getMessage(); Assert.assertEquals("DateIndexTableConfigHelper .setup threw the expected exception, but the message was not the expected message.", "No DateIndex Table Defined", msg); } finally { DateIndexTableConfigHelperTest.logger.info("DateIndexTableConfigHelperTest.testSetupNothingDefinedInConfiguration completed."); } }
@Test public void testSetupOneDateIndexTableDefinedInConfiguration() { DateIndexTableConfigHelperTest.logger.info("DateIndexTableConfigHelperTest.testSetupNothingDefinedInConfiguration called."); try { DateIndexTableConfigHelper uut = new DateIndexTableConfigHelper(); Configuration config = this.createMockConfiguration(); Logger log = this.createMockLogger(); this.configuration.put(DateIndexDataTypeHandler.DATEINDEX_TNAME, DateIndexTableConfigHelperTest.TABLE_NAME); uut.setup(DateIndexTableConfigHelperTest.TABLE_NAME, config, log); this.configuration.clear(); } finally { DateIndexTableConfigHelperTest.logger.info("DateIndexTableConfigHelperTest.testSetupNothingDefinedInConfiguration completed."); } }
@Test public void testSetupOneDateIndexTableDefinedInConfigurationButNotTableNameParameter() { DateIndexTableConfigHelperTest.logger.info("DateIndexTableConfigHelperTest.testSetupNothingDefinedInConfiguration called."); try { DateIndexTableConfigHelper uut = new DateIndexTableConfigHelper(); Configuration config = this.createMockConfiguration(); Logger log = this.createMockLogger(); this.configuration.put(DateIndexDataTypeHandler.DATEINDEX_TNAME, DateIndexTableConfigHelperTest.TABLE_NAME); try { uut.setup(DateIndexTableConfigHelperTest.BAD_TABLE_NAME, config, log); } catch (IllegalArgumentException iae) { String msg = iae.getMessage(); Assert.assertTrue("DateIndexTableConfigHelper.setup threw the expected exception, but the message was not the expected message.", msg.startsWith("Invalid DateIndex Table Definition For: ")); } this.configuration.clear(); } finally { DateIndexTableConfigHelperTest.logger.info("DateIndexTableConfigHelperTest.testSetupNothingDefinedInConfiguration completed."); } }