*/
@Test
public void testAdminAccountCreation() throws Exception
{
String userDn = "uid=admin,ou=system";
LdapContext ctx = new ServerLdapContext( service,
service.getSession( new LdapDN( userDn ), "secret".getBytes() ), new LdapDN( "ou=system" ) );
Attributes attrs = ctx.getAttributes( "uid=admin" );
performAdminAccountChecks( attrs );
assertTrue( ArrayUtils.isEquals( attrs.get( "userPassword" ).get(), StringTools.getBytesUtf8( "secret" ) ) );
ctx.close();
service.shutdown();
service.startup();
ctx = new ServerLdapContext( service,
service.getSession( new LdapDN( userDn ), "secret".getBytes() ), new LdapDN( "ou=system" ) );
attrs = ctx.getAttributes( "uid=admin" );
performAdminAccountChecks( attrs );
assertTrue( ArrayUtils.isEquals( attrs.get( "userPassword" ).get(), StringTools.getBytesUtf8( "secret" ) ) );
ctx.close();
}