@Override public String toString() { return String.format( "[%s@%d::criticality=%s, authorizationId=%s]", getClass().getName(), hashCode(), getCriticality(), authorizationId); }
/** * Creates a new proxy authorization control. * * @param id authorization identity */ public ProxyAuthorizationControl(final String id) { super(OID, true); setAuthorizationId(id); }
@Override public int hashCode() { return LdapUtils.computeHashCode(HASH_CODE_SEED, getOID(), getCriticality(), authorizationId); }
@Override public byte[] encode() { return getAuthorizationId() != null ? OctetStringType.toBytes(getAuthorizationId()) : EMPTY_AUTHZ; } }
/** * @param berValue to encode. * @param expected proxy authorization control to test. * * @throws Exception On test failure. */ @Test(groups = {"control"}, dataProvider = "request") public void decode(final byte[] berValue, final ProxyAuthorizationControl expected) throws Exception { Assert.assertEquals(expected.encode(), berValue); } }
/** * Proxy authorization control test data. * * @return response test data */ @DataProvider(name = "request") public Object[][] createData() { return new Object[][] { new Object[] { new byte[0], new ProxyAuthorizationControl(), }, // BER: // 64:6E:3A:75:69:64:3D:31:2C:6F:75:3D:74:65:73:74:2C:64:63:3D:6C:64: // 61:70:74:69:76:65:2C:64:63:3D:6F:72:67 new Object[] { LdapUtils.base64Decode("ZG46dWlkPTEsb3U9dGVzdCxkYz1sZGFwdGl2ZSxkYz1vcmc="), new ProxyAuthorizationControl("dn:uid=1,ou=test,dc=ldaptive,dc=org"), }, }; }
@Override public int hashCode() { return LdapUtils.computeHashCode(HASH_CODE_SEED, getOID(), getCriticality(), authorizationId); }
@Override public byte[] encode() { return getAuthorizationId() != null ? OctetStringType.toBytes(getAuthorizationId()) : EMPTY_AUTHZ; } }
@Override public String toString() { return String.format( "[%s@%d::criticality=%s, authorizationId=%s]", getClass().getName(), hashCode(), getCriticality(), authorizationId); }
@Override public int hashCode() { return LdapUtils.computeHashCode(HASH_CODE_SEED, getOID(), getCriticality(), authorizationId); }
@Override public byte[] encode() { return getAuthorizationId() != null ? OctetStringType.toBytes(getAuthorizationId()) : EMPTY_AUTHZ; } }
/** * Creates a new proxy authorization control. * * @param id authorization identity */ public ProxyAuthorizationControl(final String id) { super(OID, true); setAuthorizationId(id); }
@Override public String toString() { return String.format( "[%s@%d::criticality=%s, authorizationId=%s]", getClass().getName(), hashCode(), getCriticality(), authorizationId); }
/** * Creates a new proxy authorization control. * * @param id authorization identity */ public ProxyAuthorizationControl(final String id) { super(OID, true); setAuthorizationId(id); }