ctrl.setCritical( true );
SearchCursor cursor = con.search( req );
assertFalse( cursor.next() );
SearchResultDone sd = cursor.getSearchResultDone();
cursor.close();
SortResponse resp = ( SortResponse ) sd.getControl( SortResponse.OID );
assertNotNull( resp );
assertEquals( SortResultCode.NOSUCHATTRIBUTE, resp.getSortResult() );
assertEquals( sk.getAttributeTypeDesc(), resp.getAttributeName() );
assertEquals( ResultCodeEnum.UNAVAILABLE_CRITICAL_EXTENSION, sd.getLdapResult().getResultCode() );
}