ModifyDnRequest modifyDnRequest = new ModifyDnRequestImpl();
modifyDnRequest.setName( new Dn( "ou=Computers,uid=akarasuluref,ou=users,ou=system" ) );
modifyDnRequest.setNewRdn( new Rdn( "ou=Machines" ) );
modifyDnRequest.setDeleteOldRdn( true );
ModifyDnResponse modifyDnResponse = conn.modifyDn( modifyDnRequest );
assertEquals( ResultCodeEnum.REFERRAL, modifyDnResponse.getLdapResult().getResultCode() );
assertTrue( modifyDnResponse.getLdapResult().getReferral().getLdapUrls()
.contains( "ldap://localhost:10389/ou=Computers,uid=akarasulu,ou=users,ou=system" ) );
assertTrue( modifyDnResponse.getLdapResult().getReferral().getLdapUrls()
.contains( "ldap://foo:10389/ou=Computers,uid=akarasulu,ou=users,ou=system" ) );
assertTrue( modifyDnResponse.getLdapResult().getReferral().getLdapUrls()
.contains( "ldap://bar:10389/ou=Computers,uid=akarasulu,ou=users,ou=system" ) );
conn.close();
}