use of com.unboundid.ldap.sdk.ExtendedRequest in project ldapsdk by pingidentity.
the class GenerateTOTPSharedSecretExtendedRequestTestCase method testDecodeRequestValueEmptySequence.
/**
* Tests the behavior of the extended request when trying to decode a generic
* request that has a value that is an empty ASN.1 sequence.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeRequestValueEmptySequence() throws Exception {
final ExtendedRequest r = new ExtendedRequest("1.3.6.1.4.1.30221.2.6.56", new ASN1OctetString(new ASN1Sequence().encode()));
new GenerateTOTPSharedSecretExtendedRequest(r);
}
use of com.unboundid.ldap.sdk.ExtendedRequest in project ldapsdk by pingidentity.
the class GenerateTOTPSharedSecretExtendedRequestTestCase method testDecodeRequestValueSequenceUnrecognizedElementType.
/**
* Tests the behavior of the extended request when trying to decode a generic
* request that has a value that is an ASN.1 sequence with an unrecognized
* element type.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeRequestValueSequenceUnrecognizedElementType() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1OctetString((byte) 0x80, "u:test.user"), new ASN1OctetString((byte) 0x12, "invalid-type"));
final ExtendedRequest r = new ExtendedRequest("1.3.6.1.4.1.30221.2.6.56", new ASN1OctetString(valueSequence.encode()));
new GenerateTOTPSharedSecretExtendedRequest(r);
}
use of com.unboundid.ldap.sdk.ExtendedRequest in project ldapsdk by pingidentity.
the class GetBackupCompatibilityDescriptorExtendedRequestTestCase method testDecodeValueNotSequence.
/**
* Tests the behavior when attempting to decode an extended request whose
* value is not a valid ASN.1 sequence.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeValueNotSequence() throws Exception {
final ExtendedRequest r = new ExtendedRequest("1.3.6.1.4.1.30221.2.6.30", new ASN1OctetString("foo"));
new GetBackupCompatibilityDescriptorExtendedRequest(r);
}
use of com.unboundid.ldap.sdk.ExtendedRequest in project ldapsdk by pingidentity.
the class GetChangelogBatchExtendedRequestTestCase method testDecodeValueSequenceInvalidChangeType.
/**
* Provides test coverage for an attempt to decode an extended request with a
* value sequence with an invalid change type.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeValueSequenceInvalidChangeType() throws Exception {
final ASN1Set changeTypeSet = new ASN1Set((byte) 0xA4, new ASN1Enumerated(0), new ASN1Enumerated(5));
final ASN1Sequence valueSequence = new ASN1Sequence(new EndOfChangelogStartingPoint().encode(), new ASN1Integer(0), changeTypeSet);
new GetChangelogBatchExtendedRequest(new ExtendedRequest(GetChangelogBatchExtendedRequest.GET_CHANGELOG_BATCH_REQUEST_OID, new ASN1OctetString(valueSequence.encode())));
}
use of com.unboundid.ldap.sdk.ExtendedRequest in project ldapsdk by pingidentity.
the class GetChangelogBatchExtendedRequestTestCase method testDecodeValueSequenceMalformedIncludeList.
/**
* Provides test coverage for an attempt to decode an extended request with a
* value sequence with a set of include base DNs that cannot be parsed.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeValueSequenceMalformedIncludeList() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new EndOfChangelogStartingPoint().encode(), new ASN1OctetString("foo"), new ASN1OctetString((byte) 0xA2, "bar"));
new GetChangelogBatchExtendedRequest(new ExtendedRequest(GetChangelogBatchExtendedRequest.GET_CHANGELOG_BATCH_REQUEST_OID, new ASN1OctetString(valueSequence.encode())));
}
Aggregations