@@ -89,7 +89,7 @@ impl BytesSerializable for UpdateTopic {
89
89
let stream_id_bytes = self . stream_id . to_bytes ( ) ;
90
90
let topic_id_bytes = self . topic_id . to_bytes ( ) ;
91
91
let mut bytes = BytesMut :: with_capacity (
92
- 14 + stream_id_bytes. len ( ) + topic_id_bytes. len ( ) + self . name . len ( ) ,
92
+ 19 + stream_id_bytes. len ( ) + topic_id_bytes. len ( ) + self . name . len ( ) ,
93
93
) ;
94
94
bytes. put_slice ( & stream_id_bytes. clone ( ) ) ;
95
95
bytes. put_slice ( & topic_id_bytes. clone ( ) ) ;
@@ -107,7 +107,7 @@ impl BytesSerializable for UpdateTopic {
107
107
}
108
108
109
109
fn from_bytes ( bytes : Bytes ) -> Result < UpdateTopic , IggyError > {
110
- if bytes. len ( ) < 16 {
110
+ if bytes. len ( ) < 21 {
111
111
return Err ( IggyError :: InvalidCommand ) ;
112
112
}
113
113
let mut position = 0 ;
@@ -229,7 +229,7 @@ mod tests {
229
229
let stream_id_bytes = stream_id. to_bytes ( ) ;
230
230
let topic_id_bytes = topic_id. to_bytes ( ) ;
231
231
let mut bytes =
232
- BytesMut :: with_capacity ( 5 + stream_id_bytes. len ( ) + topic_id_bytes. len ( ) + name. len ( ) ) ;
232
+ BytesMut :: with_capacity ( 19 + stream_id_bytes. len ( ) + topic_id_bytes. len ( ) + name. len ( ) ) ;
233
233
bytes. put_slice ( & stream_id_bytes) ;
234
234
bytes. put_slice ( & topic_id_bytes) ;
235
235
bytes. put_u8 ( compression_algorithm. as_code ( ) ) ;
@@ -247,8 +247,10 @@ mod tests {
247
247
let command = command. unwrap ( ) ;
248
248
assert_eq ! ( command. stream_id, stream_id) ;
249
249
assert_eq ! ( command. topic_id, topic_id) ;
250
+ assert_eq ! ( command. compression_algorithm, compression_algorithm) ;
250
251
assert_eq ! ( command. message_expiry, message_expiry) ;
251
- assert_eq ! ( command. stream_id, stream_id) ;
252
- assert_eq ! ( command. topic_id, topic_id) ;
252
+ assert_eq ! ( command. max_topic_size, max_topic_size) ;
253
+ assert_eq ! ( command. replication_factor, Some ( replication_factor) ) ;
254
+ assert_eq ! ( command. name, name) ;
253
255
}
254
256
}
0 commit comments