### Question:
LMISConfiguration implements IConfiguration { @Override public Map<String, Object> generateMetaData() throws IOException { return buildConfigurationFromFile(); } LMISConfiguration(CategoryCombo defaultCategoryCombo); @Override Map<String, Object> generateMetaData(); static List<ExcelCategory> getCategories(BufferedReader bufferedReader); static List<String> getCategoryNames(BufferedReader bufferedReader); static final String DATA_ELEMENTS; static final String DATA_ELEMENT_GROUPS; static final String DATA_ELEMENT_GROUP_SETS; static final String DATA_SETS; static final String OPTION_SETS; static final String INDICATOR_TYPES; static final String INDICATORS; static final String ATTRIBUTES; static final String CONSTANTS; static final String OPTIONS; }### Answer:
@Test public void shouldHaveTwoAttributesForEachDataElementGroup() throws Exception { LMISConfiguration configuration = getLmisConfiguration(); List<DataElementGroup> groups = (List<DataElementGroup>) configuration.generateMetaData().get(LMISConfiguration.DATA_ELEMENT_GROUPS); for (DataElementGroup group : groups) { assertThat(group.getAttributeValues().size(), is(3)); assertThat(group.getAttributeValues().get(0).getAttribute().getDataElementGroupAttribute(), is(true)); assertThat(group.getAttributeValues().get(0).getAttribute().getDataElementAttribute(), is(false)); assertThat(group.getAttributeValues().get(0).getAttribute().getName(), is(Attribute.LMIS_NON_LGA)); assertThat(group.getAttributeValues().get(1).getAttribute().getDataElementAttribute(), is(false)); assertThat(group.getAttributeValues().get(1).getAttribute().getName(), is(Attribute.LMIS_DEVICE)); assertThat(group.getAttributeValues().get(2).getAttribute().getDataElementAttribute(), is(false)); assertThat(group.getAttributeValues().get(2).getAttribute().getName(), is(Attribute.LMIS_VACCINE)); } }
@Test public void shouldHaveSomeGroupsConfiguredAsDevices() throws Exception { LMISConfiguration configuration = getLmisConfiguration(); List<DataElementGroup> groups = (List<DataElementGroup>) configuration.generateMetaData().get(LMISConfiguration.DATA_ELEMENT_GROUPS); for (DataElementGroup group : groups) { if (group.getName().toLowerCase().contains("syringe")) { assertThat(group.getName(),group.getAttributeValues().size(), is(3)); assertThat(group.getName(),group.getAttributeValues().get(0).getAttribute().getDataElementGroupAttribute(), is(true)); assertThat(group.getName(),group.getAttributeValues().get(0).getAttribute().getDataElementAttribute(), is(false)); assertThat(group.getName(),group.getAttributeValues().get(0).getAttribute().getName(), is(Attribute.LMIS_NON_LGA)); assertThat(group.getName(),group.getAttributeValues().get(1).getAttribute().getDataElementAttribute(), is(false)); assertThat(group.getName(),group.getAttributeValues().get(1).getAttribute().getName(), is(Attribute.LMIS_DEVICE)); assertThat(group.getName(),group.getAttributeValues().get(1).getValue(), is("1")); assertThat(group.getName(),group.getAttributeValues().get(2).getAttribute().getName(), is(Attribute.LMIS_VACCINE)); assertThat(group.getName(),group.getAttributeValues().get(2).getValue(), is("1")); } } }