}
private void assertAuthenticate(String login, String password, String xwikiUserName, String storedDn,
String storedUid) throws XWikiException
{
Principal principal = this.ldapAuth.authenticate(login, password, getContext());
// Check that authentication return a valid Principal
assertNotNull("Authentication failed", principal);
// Check that the returned Principal has the good name
assertEquals("Wrong returned principal", xwikiUserName, principal.getName());
XWikiDocument userProfile = getDocument(xwikiUserName);
// check hat user has been created
assertTrue("The user profile has not been created", !userProfile.isNew());