@Test public void shouldExtractNestedRefConfigs() { Map<String, DidRefConfig> refConfigs = didSchemaParser.getRefConfigs(); Assert.assertEquals("Should extract 9 ref configs for the SLC section and edOrg referenceTypes", 9, refConfigs.size()); Assert.assertTrue(refConfigs.containsKey(SECTION_TYPE)); Assert.assertTrue(refConfigs.containsKey(EDORG_TYPE)); DidRefConfig sectionRefConfig = refConfigs.get(SECTION_TYPE); Assert.assertNotNull(sectionRefConfig); Assert.assertEquals(sectionRefConfig.getEntityType(), SECTION_TYPE); Assert.assertNotNull(sectionRefConfig.getKeyFields()); List<KeyFieldDef> keyFields = sectionRefConfig.getKeyFields(); Assert.assertEquals("keyFields list should contain 2 keyfields", 2, keyFields.size()); Map<String, KeyFieldDef> keyFieldMap = new HashMap<String, KeyFieldDef>(); for (KeyFieldDef keyField : keyFields) { keyFieldMap.put(keyField.getKeyFieldName(), keyField); } Assert.assertTrue(keyFieldMap.containsKey(SECTION_KEY_FIELD)); KeyFieldDef uniqSectionCode = keyFieldMap.get(SECTION_KEY_FIELD); Assert.assertNotNull(uniqSectionCode); Assert.assertEquals(SECTION_KEY_FIELD, uniqSectionCode.getKeyFieldName()); Assert.assertNull("uniqueSectionCode should not have a nested DID", uniqSectionCode.getRefConfig()); Assert.assertEquals("SectionIdentity.UniqueSectionCode._value", uniqSectionCode.getValueSource()); Assert.assertTrue(keyFieldMap.containsKey(SECTION_SCHOOL_KEYFIELD)); KeyFieldDef schoolId = keyFieldMap.get(SECTION_SCHOOL_KEYFIELD); Assert.assertEquals(SECTION_SCHOOL_KEYFIELD, schoolId.getKeyFieldName()); Assert.assertNotNull("schoolId should have a nested DID", schoolId.getRefConfig()); Assert.assertNotNull("schoolId should have a value source", schoolId.getValueSource()); Assert.assertNotNull("SectionIdentity.EducationalOrgReference", schoolId.getValueSource()); DidRefConfig nestedRefConfig = schoolId.getRefConfig(); Assert.assertEquals(EDORG_TYPE, nestedRefConfig.getEntityType()); Assert.assertNotNull(nestedRefConfig.getKeyFields()); Assert.assertEquals("nested schoolId ref should contain 1 key field", 1, nestedRefConfig.getKeyFields().size()); KeyFieldDef stateOrgId = nestedRefConfig.getKeyFields().get(0); Assert.assertNotNull(stateOrgId); Assert.assertEquals(SCHOOL_KEYFIELD, stateOrgId.getKeyFieldName()); Assert.assertEquals("EducationalOrgIdentity.StateOrganizationId._value", stateOrgId.getValueSource()); Assert.assertNull("nested stateOrgId should not contain a nested reference", stateOrgId.getRefConfig()); }
public Map<String, DidRefConfig> getRefConfigs() { return refConfigs; }
DidSchemaParser implements ResourceLoaderAware { public Map<String, DidRefConfig> getRefConfigs() { return refConfigs; } }
DidSchemaParser implements ResourceLoaderAware { public Map<String, DidRefConfig> getRefConfigs() { return refConfigs; }  }
DidSchemaParser implements ResourceLoaderAware { public Map<String, DidRefConfig> getRefConfigs() { return refConfigs; }  String getExtensionXsdLocation(); void setExtensionXsdLocation(String entensionXsdLocation); String getExtensionXsdParentLocation(); void setExtensionXsdParentLocation(String extensionXsdParentLocation); String getXsdParentLocation(); void setXsdParentLocation(String xsdParentLocation); String getXsdLocation(); void setXsdLocation(String xsdLocation); Map<String, List<DidNaturalKey>> getNaturalKeys(); void setNaturalKeys(Map<String, List<DidNaturalKey>> naturalKeys); @Override void setResourceLoader(ResourceLoader resourceLoader); @PostConstruct void setup(); Map<String, DidRefConfig> getRefConfigs(); Map<String, DidEntityConfig> getEntityConfigs(); Map<String, List<DidNaturalKey>> extractNaturalKeys(); }
DidSchemaParser implements ResourceLoaderAware { public Map<String, DidRefConfig> getRefConfigs() { return refConfigs; }  String getExtensionXsdLocation(); void setExtensionXsdLocation(String entensionXsdLocation); String getExtensionXsdParentLocation(); void setExtensionXsdParentLocation(String extensionXsdParentLocation); String getXsdParentLocation(); void setXsdParentLocation(String xsdParentLocation); String getXsdLocation(); void setXsdLocation(String xsdLocation); Map<String, List<DidNaturalKey>> getNaturalKeys(); void setNaturalKeys(Map<String, List<DidNaturalKey>> naturalKeys); @Override void setResourceLoader(ResourceLoader resourceLoader); @PostConstruct void setup(); Map<String, DidRefConfig> getRefConfigs(); Map<String, DidEntityConfig> getEntityConfigs(); Map<String, List<DidNaturalKey>> extractNaturalKeys();  }