ArrayList<Control> controls = new ArrayList<Control>(1);
controls.add(new ProxiedAuthV1Control(targetDN));
// Test a compare operation against the PWReset Target user.
CompareOperationBasis compareOperation =
new CompareOperationBasis(conn, conn.nextOperationID(),
conn.nextMessageID(), controls, targetDN,
DirectoryServer.getAttributeType("cn", true),
ByteString.valueOf("PWReset Target"));
compareOperation.run();
if (hasProxyPrivilege)
{
assertEquals(compareOperation.getResultCode(), ResultCode.COMPARE_TRUE);
}
else
{
assertEquals(compareOperation.getResultCode(),
ResultCode.AUTHORIZATION_DENIED);
}
// Test a search operation against the PWReset Target user.