@Test public void testParseConfigurationTags() throws Exception { when(attributes.getAll()).thenReturn(attributesNamingEnumeration); when(attributesNamingEnumeration.hasMore()).thenReturn(true, false); when(attributesNamingEnumeration.next()).thenReturn(attribute); final String attributeId = "uid"; when(attribute.getID()).thenReturn(attributeId); final String attributeValue = "some value"; when(attribute.get()).thenReturn(attributeValue); when(attribute.size()).thenReturn(1); final String tag = "tag"; final LdapConfigurationStore ldapConfigurationStore = new LdapConfigurationStore(new LdapConfigurationStore(), attributes, tag); final Collection<TaggedPropertySet> taggedPropertySets = ldapConfigurationStore.parseConfiguration(); assertEquals(1, taggedPropertySets.size()); final TaggedPropertySet taggedPropertySet = taggedPropertySets.iterator().next(); assertEquals(tag, taggedPropertySet.tag()); verify(attributes).getAll(); verify(attributesNamingEnumeration, times(2)).hasMore(); verify(attributesNamingEnumeration).next(); verify(attribute, times(2)).getID(); verify(attribute).get(); verify(attribute).size(); }
public Collection<TaggedPropertySet> parseConfiguration() { Map<String, String> properties = new HashMap<String, String>(keyAttributesMap.size()); for (String key : keyAttributesMap.keySet()) { properties.putAll(convertAttributesToProperties(key, keyAttributesMap.get(key))); } return createTaggedPropertySetsFromProperties(properties); }
LdapConfigurationStore implements ConfigurationStore { public Collection<TaggedPropertySet> parseConfiguration() { Map<String, String> properties = new HashMap<String, String>(keyAttributesMap.size()); for (String key : keyAttributesMap.keySet()) { properties.putAll(convertAttributesToProperties(key, keyAttributesMap.get(key))); } return createTaggedPropertySetsFromProperties(properties); } }
LdapConfigurationStore implements ConfigurationStore { public Collection<TaggedPropertySet> parseConfiguration() { Map<String, String> properties = new HashMap<String, String>(keyAttributesMap.size()); for (String key : keyAttributesMap.keySet()) { properties.putAll(convertAttributesToProperties(key, keyAttributesMap.get(key))); } return createTaggedPropertySetsFromProperties(properties); } LdapConfigurationStore(); private  LdapConfigurationStore(List<String> tags);  LdapConfigurationStore(LdapConfigurationStore oldStore,
                                  String key,
                                  Attributes attributes, String... tags);  LdapConfigurationStore(LdapConfigurationStore oldStore, Attributes attributes, String... tags); }
LdapConfigurationStore implements ConfigurationStore { public Collection<TaggedPropertySet> parseConfiguration() { Map<String, String> properties = new HashMap<String, String>(keyAttributesMap.size()); for (String key : keyAttributesMap.keySet()) { properties.putAll(convertAttributesToProperties(key, keyAttributesMap.get(key))); } return createTaggedPropertySetsFromProperties(properties); } LdapConfigurationStore(); private  LdapConfigurationStore(List<String> tags);  LdapConfigurationStore(LdapConfigurationStore oldStore,
                                  String key,
                                  Attributes attributes, String... tags);  LdapConfigurationStore(LdapConfigurationStore oldStore, Attributes attributes, String... tags); Collection<TaggedPropertySet> parseConfiguration(); }
LdapConfigurationStore implements ConfigurationStore { public Collection<TaggedPropertySet> parseConfiguration() { Map<String, String> properties = new HashMap<String, String>(keyAttributesMap.size()); for (String key : keyAttributesMap.keySet()) { properties.putAll(convertAttributesToProperties(key, keyAttributesMap.get(key))); } return createTaggedPropertySetsFromProperties(properties); } LdapConfigurationStore(); private  LdapConfigurationStore(List<String> tags);  LdapConfigurationStore(LdapConfigurationStore oldStore,
                                  String key,
                                  Attributes attributes, String... tags);  LdapConfigurationStore(LdapConfigurationStore oldStore, Attributes attributes, String... tags); Collection<TaggedPropertySet> parseConfiguration();  }