LDAPConstraints constraints = new LDAPConstraints();
conn.setConstraints( constraints );
// referrals failure
LDAPAttributeSet attrSet = new LDAPAttributeSet();
attrSet.add( new LDAPAttribute( "objectClass", "organizationalUnit" ) );
attrSet.add( new LDAPAttribute( "ou", "UnderReferral" ) );
LDAPEntry entry = new LDAPEntry( "ou=UnderReferral,ou=Computers,uid=akarasuluref,ou=users,ou=system", attrSet );
LDAPResponseListener listener = conn.add( entry, null, constraints );
LDAPResponse response = listener.getResponse();
assertEquals( ResultCodeEnum.REFERRAL.getValue(), response.getResultCode() );