@Test
public void testOnReferralWithManageDsaITControl() throws Exception
{
LdapConnection conn = getWiredConnection( getLdapServer() );
AddRequest addRequest = new AddRequestImpl();
ManageDsaIT manageDSAIT = new ManageDsaITImpl();
manageDSAIT.setCritical( true );
addRequest.addControl( manageDSAIT );
// add success
Entry entry = new DefaultEntry( "ou=UnderReferral,uid=akarasuluref,ou=users,ou=system",
"objectClass", "organizationalUnit",
"ou", "UnderReferral" );
addRequest.setEntry( entry );
AddResponse addResponse = conn.add( addRequest );
assertEquals( ResultCodeEnum.REFERRAL, addResponse.getLdapResult().getResultCode() );
assertNull( conn.lookup( "ou=UnderReferral,uid=akarasuluref,ou=users,ou=system", new Control[]