File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -990,7 +990,31 @@ mod tests {
990
990
// simulated broker, just reads messages and answers w/ "api versions" responses
991
991
let handle_broker = tokio:: spawn ( async move {
992
992
for correlation_id in 0 .. {
993
- rx_back. read_message ( 1_000 ) . await . unwrap ( ) ;
993
+ let data = rx_back. read_message ( 1_000 ) . await . unwrap ( ) ;
994
+ let mut data = Cursor :: new ( data) ;
995
+ let header =
996
+ RequestHeader :: read_versioned ( & mut data, ApiVersion ( Int16 ( 1 ) ) ) . unwrap ( ) ;
997
+ assert_eq ! (
998
+ header,
999
+ RequestHeader {
1000
+ request_api_key: ApiKey :: ApiVersions ,
1001
+ request_api_version: ApiVersion ( Int16 ( 0 ) ) ,
1002
+ correlation_id: Int32 ( correlation_id) ,
1003
+ client_id: Some ( NullableString ( None ) ) ,
1004
+ tagged_fields: None ,
1005
+ }
1006
+ ) ;
1007
+ let body =
1008
+ ApiVersionsRequest :: read_versioned ( & mut data, ApiVersion ( Int16 ( 0 ) ) ) . unwrap ( ) ;
1009
+ assert_eq ! (
1010
+ body,
1011
+ ApiVersionsRequest {
1012
+ client_software_name: None ,
1013
+ client_software_version: None ,
1014
+ tagged_fields: None ,
1015
+ }
1016
+ ) ;
1017
+ assert_eq ! ( data. position( ) as usize , data. get_ref( ) . len( ) ) ;
994
1018
995
1019
let mut msg = vec ! [ ] ;
996
1020
ResponseHeader {
You can’t perform that action at this time.
0 commit comments