Skip to content

Commit

Permalink
Fix testLoadLDAP (neo4j-contrib#3022) (neo4j-contrib#3026)
Browse files Browse the repository at this point in the history
Co-authored-by: Giuseppe Villani <[email protected]>
  • Loading branch information
2 people authored and gem-neo4j committed Jul 12, 2022
1 parent bb39fed commit d9f5b70
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions full/src/test/java/apoc/load/LoadLdapTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,23 @@ public class LoadLdapTest {
@Test
public void testLoadLDAP() throws Exception {
Map<String, Object> connParms = new HashMap<>();
connParms.put("ldapHost", "ldap.forumsys.com");
connParms.put("ldapHost", "ipa.demo1.freeipa.org");
connParms.put("ldapPort", 389l);
connParms.put("loginDN", "cn=read-only-admin,dc=example,dc=com");
connParms.put("loginPW", "password");
connParms.put("loginDN", "uid=admin,cn=users,cn=accounts,dc=demo1,dc=freeipa,dc=org");
connParms.put("loginPW", "Secret123");
LoadLdap.LDAPManager mgr = new LoadLdap.LDAPManager(LoadLdap.getConnectionMap(connParms));
Map<String, Object> searchParms = new HashMap<>();
searchParms.put("searchBase", "dc=example,dc=com");
searchParms.put("searchBase", "dc=demo1,dc=freeipa,dc=org");
searchParms.put("searchScope", "SCOPE_ONE");
searchParms.put("searchFilter", "(&(objectClass=*)(uid=training))");
searchParms.put("searchFilter", "(&(objectclass=*)(cn=alt))");
ArrayList<String> ats = new ArrayList<>();
ats.add("uid");
final String attrName = "cn";
ats.add(attrName);
searchParms.put("attributes", ats);
LDAPSearchResults results = mgr.doSearch(searchParms);
LDAPEntry le = results.next();
assertEquals("uid=training,dc=example,dc=com", le.getDN());
assertEquals("training", le.getAttribute("uid").getStringValue());
assertEquals("cn=alt,dc=demo1,dc=freeipa,dc=org", le.getDN());
assertEquals("alt", le.getAttribute(attrName).getStringValue());
}

}
Expand Down

0 comments on commit d9f5b70

Please sign in to comment.