assertAuthenticate(LDAPTestSetup.HORATIOHORNBLOWER_CN, LDAPTestSetup.HORATIOHORNBLOWER_PWD,
LDAPTestSetup.HORATIOHORNBLOWER_DN);
XWikiDocument userProfile = getDocument("XWiki." + LDAPTestSetup.HORATIOHORNBLOWER_CN);
BaseObject userProfileObj = userProfile.getObject(USER_XCLASS);
assertEquals(LDAPTestSetup.HORATIOHORNBLOWER_SN, userProfileObj.getStringValue("last_name"));
assertEquals(LDAPTestSetup.HORATIOHORNBLOWER_GIVENNAME, userProfileObj.getStringValue("first_name"));
assertEquals(LDAPTestSetup.HORATIOHORNBLOWER_MAIL, userProfileObj.getStringValue("email"));
// Check non mapped properties are not touched
userProfileObj.setStringValue("customproperty", "customvalue");
assertAuthenticate(LDAPTestSetup.HORATIOHORNBLOWER_CN, LDAPTestSetup.HORATIOHORNBLOWER_PWD,
LDAPTestSetup.HORATIOHORNBLOWER_DN);
userProfile = getDocument("XWiki." + LDAPTestSetup.HORATIOHORNBLOWER_CN);
userProfileObj = userProfile.getObject(USER_XCLASS);
assertEquals("customvalue", userProfileObj.getStringValue("customproperty"));
}