DefaultIncrementalAttributesMapper implements IncrementalAttributesMapper<DefaultIncrementalAttributesMapper> { @Override public final String[] getAttributesForLookup() { String[] result = new String[rangedAttributesInNextIteration.size()]; int index = 0; for (String next : rangedAttributesInNextIteration) { IncrementalAttributeState state = stateMap.get(next); result[index++] = state.getAttributeNameForQuery(); } return result; } DefaultIncrementalAttributesMapper(String attributeName);  DefaultIncrementalAttributesMapper(String[] attributeNames);  DefaultIncrementalAttributesMapper(int pageSize, String attributeName);  DefaultIncrementalAttributesMapper(int pageSize, String[] attributeNames); @Override final DefaultIncrementalAttributesMapper mapFromAttributes(Attributes attributes); @Override final List<Object> getValues(String attributeName); @Override final Attributes getCollectedAttributes(); @Override final boolean hasMore(); @Override final String[] getAttributesForLookup(); static Attributes lookupAttributes(LdapOperations ldapOperations, String dn, String attribute); static Attributes lookupAttributes(LdapOperations ldapOperations, String dn, String[] attributes); static Attributes lookupAttributes(LdapOperations ldapOperations, Name dn, String attribute); static Attributes lookupAttributes(LdapOperations ldapOperations, Name dn, String[] attributes); static List<Object> lookupAttributeValues(LdapOperations ldapOperations, String dn, String attribute); static List<Object> lookupAttributeValues(LdapOperations ldapOperations, Name dn, String attribute);  }
@Test public void testGetAttributesArray() throws Exception { String[] attributes = tested.getAttributesForLookup(); assertThat(attributes.length).isEqualTo(1); assertThat(attributes[0]).isEqualTo("member"); tested = new DefaultIncrementalAttributesMapper(10, "member"); attributes = tested.getAttributesForLookup(); assertThat(attributes.length).isEqualTo(1); assertThat(attributes[0]).isEqualTo("member;Range=0-10"); }
@Test public void testGetAttributesArrayWithTwoAttributes() { tested = new DefaultIncrementalAttributesMapper(20, new String[]{"member", "cn"}); String[] attributes = tested.getAttributesForLookup(); assertThat(attributes.length).isEqualTo(2); assertThat(attributes[0]).isEqualTo("member;Range=0-20"); assertThat(attributes[1]).isEqualTo("cn;Range=0-20"); }