{
de.printStackTrace();
fail( de.getMessage() );
}
UnbindRequest unbindRequest = ldapMessageContainer.getMessage();
assertEquals( 1, unbindRequest.getMessageId() );
// Check the Control
Map<String, Control> controls = unbindRequest.getControls();
assertEquals( 1, controls.size() );
@SuppressWarnings("unchecked")
CodecControl<Control> control = ( org.apache.directory.api.ldap.codec.api.CodecControl<Control> ) controls
.get( "2.16.840.1.113730.3.4.2" );
assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
assertEquals( "", Strings.dumpBytes( ( byte[] ) control.getValue() ) );
// Check the encoding
UnbindRequest internalUnbindRequest = new UnbindRequestImpl();
internalUnbindRequest.setMessageId( unbindRequest.getMessageId() );
internalUnbindRequest.addControl( control );
try
{
ByteBuffer bb = encoder.encodeMessage( internalUnbindRequest );