use of com.github.zhenwei.core.asn1.ASN1Boolean in project ldapsdk by pingidentity.
the class UnboundIDExternallyProcessedAuthenticationBindRequestTestCase method testDecodeCredentialsMissingExternalMechanismName.
/**
* Tests the behavior when trying to decode an ASN.1 element that represents
* encoded credentials that would be valid except that it is missing the
* required externalMechanismName element.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeCredentialsMissingExternalMechanismName() throws Exception {
final ASN1Sequence credSequence = new ASN1Sequence(new ASN1OctetString((byte) 0x80, "dn:uid=test.user,ou=People,dc=example,dc=com"), new ASN1Boolean((byte) 0x82, true));
UnboundIDExternallyProcessedAuthenticationBindRequest.decodeSASLCredentials(new ASN1OctetString(credSequence.encode()));
}
use of com.github.zhenwei.core.asn1.ASN1Boolean in project ldapsdk by pingidentity.
the class AssuredReplicationResponseControlTestCase method testDecodeValueSequenceMalformedLocalLevel.
/**
* Tests the behavior when trying to decode a control whose value sequence
* contains a malformed local level.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeValueSequenceMalformedLocalLevel() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1Enumerated((byte) 0x80, 1234), new ASN1Boolean((byte) 0x81, true), new ASN1Boolean((byte) 0x84, true));
new AssuredReplicationResponseControl("1.3.6.1.4.1.30221.2.5.29", false, new ASN1OctetString(valueSequence.encode()));
}
use of com.github.zhenwei.core.asn1.ASN1Boolean in project ldapsdk by pingidentity.
the class AssuredReplicationResponseControlTestCase method testDecodeValueSequenceMalformedRemoteLevel.
/**
* Tests the behavior when trying to decode a control whose value sequence
* contains a malformed remote level.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeValueSequenceMalformedRemoteLevel() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1Boolean((byte) 0x81, true), new ASN1Boolean((byte) 0x84, true), new ASN1Enumerated((byte) 0x83, 1234));
new AssuredReplicationResponseControl("1.3.6.1.4.1.30221.2.5.29", false, new ASN1OctetString(valueSequence.encode()));
}
use of com.github.zhenwei.core.asn1.ASN1Boolean in project ldapsdk by pingidentity.
the class AssuredReplicationResponseControlTestCase method testDecodeValueSequenceMissingLocalSatisfied.
/**
* Tests the behavior when trying to decode a control whose value sequence
* does not include an element indicating whether the local assurance was
* satisfied.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeValueSequenceMissingLocalSatisfied() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1Boolean((byte) 0x84, true));
new AssuredReplicationResponseControl("1.3.6.1.4.1.30221.2.5.29", false, new ASN1OctetString(valueSequence.encode()));
}
use of com.github.zhenwei.core.asn1.ASN1Boolean in project ldapsdk by pingidentity.
the class AssuredReplicationResponseControlTestCase method testDecodeValueSequenceMissingRemoteSatisfied.
/**
* Tests the behavior when trying to decode a control whose value sequence
* does not include an element indicating whether the remote assurance was
* satisfied.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeValueSequenceMissingRemoteSatisfied() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1Boolean((byte) 0x81, true));
new AssuredReplicationResponseControl("1.3.6.1.4.1.30221.2.5.29", false, new ASN1OctetString(valueSequence.encode()));
}
Aggregations