compareRequest.setAssertionValue( "akarasulu" );
ManageDsaIT manageDSAIT = new ManageDsaITImpl();
manageDSAIT.setCritical( false );
compareRequest.addControl( manageDSAIT );
CompareResponse compareResponse = conn.compare( compareRequest );
assertEquals( ResultCodeEnum.COMPARE_TRUE, compareResponse.getLdapResult().getResultCode() );
// referrals failure
compareRequest = new CompareRequestImpl();
compareRequest.setName( new Dn( "uid=akarasuluREF,ou=users,ou=system" ) );
compareRequest.setAttributeId( "uid" );
compareRequest.setAssertionValue( "akarasulu" );
compareResponse = conn.compare( compareRequest );
assertEquals( ResultCodeEnum.REFERRAL, compareResponse.getLdapResult().getResultCode() );
assertTrue( compareResponse.getLdapResult().getReferral().getLdapUrls()
.contains( "ldap://localhost:10389/uid=akarasulu,ou=users,ou=system" ) );
assertTrue( compareResponse.getLdapResult().getReferral().getLdapUrls()
.contains( "ldap://foo:10389/uid=akarasulu,ou=users,ou=system" ) );
assertTrue( compareResponse.getLdapResult().getReferral().getLdapUrls()
.contains( "ldap://bar:10389/uid=akarasulu,ou=users,ou=system" ) );
conn.close();
}