use of com.github.zhenwei.core.asn1.ASN1Sequence in project ldapsdk by pingidentity.
the class IntermediateClientRequestValueTestCase method testDecodeInvalidType.
/**
* Tests the {@code decode} method with an element containing an invalid type.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeInvalidType() throws Exception {
ASN1Element[] elements = { new ASN1Element((byte) 0x00, new byte[0]) };
IntermediateClientRequestValue.decode(new ASN1Sequence(elements));
}
use of com.github.zhenwei.core.asn1.ASN1Sequence in project ldapsdk by pingidentity.
the class IntermediateClientRequestValueTestCase method testDecodeInvalidDownstreamRequest.
/**
* Tests the {@code decode} method with an element containing an invalid
* downstream request.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeInvalidDownstreamRequest() throws Exception {
ASN1Element[] downstreamElements = { new ASN1Element((byte) 0x00, new byte[0]) };
ASN1Element[] elements = { new ASN1Sequence((byte) 0xA0, downstreamElements) };
IntermediateClientRequestValue.decode(new ASN1Sequence(elements));
}
use of com.github.zhenwei.core.asn1.ASN1Sequence in project ldapsdk by pingidentity.
the class IntermediateClientResponseValueTestCase method testDecodeInvalidUpstreamResponse.
/**
* Tests the {@code decode} method with an element containing an invalid
* upstream response.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeInvalidUpstreamResponse() throws Exception {
ASN1Element[] downstreamElements = { new ASN1Element((byte) 0x00, new byte[0]) };
ASN1Element[] elements = { new ASN1Sequence((byte) 0xA0, downstreamElements) };
IntermediateClientResponseValue.decode(new ASN1Sequence(elements));
}
use of com.github.zhenwei.core.asn1.ASN1Sequence in project ldapsdk by pingidentity.
the class IntermediateClientResponseValueTestCase method testDecodeInvalidUpstreamServerSecure.
/**
* Tests the {@code decode} method with an element containing an invalid
* upstream server secure value.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeInvalidUpstreamServerSecure() throws Exception {
ASN1Element[] elements = { new ASN1Element((byte) 0x82, new byte[0]) };
IntermediateClientResponseValue.decode(new ASN1Sequence(elements));
}
use of com.github.zhenwei.core.asn1.ASN1Sequence in project ldapsdk by pingidentity.
the class MatchingEntryCountRequestControlTestCase method testDecodeValueSequenceNegativeMaxCandidatesToExamine.
/**
* Tests the behavior when trying to decode a control whose value sequence
* includes a max candidates to examine element with a negative value.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeValueSequenceNegativeMaxCandidatesToExamine() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1Integer((byte) 0x80, -1));
new MatchingEntryCountRequestControl(new Control("1.3.6.1.4.1.30221.2.5.36", true, new ASN1OctetString(valueSequence.encode())));
}
Aggregations