MCPcopy
hub / github.com/IBM/sarama / TestMetadataResponseV6

Function TestMetadataResponseV6

metadata_response_test.go:367–392  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

365}
366
367func TestMetadataResponseV6(t *testing.T) {
368 response := MetadataResponse{}
369
370 testVersionDecodable(t, "no brokers, 1 topic with offline replica V5", &response, OneTopicV6, 6)
371 if response.ThrottleTimeMs != int32(7) {
372 t.Error("Decoding produced", response.ThrottleTimeMs, "should have been 7!")
373 }
374 if len(response.Brokers) != 1 {
375 t.Error("Decoding produced", response.Brokers, "should have been 1!")
376 }
377 if response.Brokers[0].addr != "host:9092" {
378 t.Error("Decoding produced", response.Brokers[0].addr, "should have been host:9092!")
379 }
380 if response.ControllerID != int32(1) {
381 t.Error("Decoding produced", response.ControllerID, "should have been 1!")
382 }
383 if *response.ClusterID != "clusterId" {
384 t.Error("Decoding produced", response.ClusterID, "should have been clusterId!")
385 }
386 if len(response.Topics) != 1 {
387 t.Error("Decoding produced", len(response.Topics), "should have been 1!")
388 }
389 if len(response.Topics[0].Partitions[0].OfflineReplicas) != 0 {
390 t.Error("Decoding produced", len(response.Topics[0].Partitions[0].OfflineReplicas), "should have been 0!")
391 }
392}
393
394func TestMetadataResponseV7(t *testing.T) {
395 response := MetadataResponse{}

Callers

nothing calls this directly

Calls 2

testVersionDecodableFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected