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

Function TestMetadataResponseWithOfflineReplicasV5

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

Source from the content-addressed store, hash-verified

341}
342
343func TestMetadataResponseWithOfflineReplicasV5(t *testing.T) {
344 response := MetadataResponse{}
345
346 testVersionDecodable(t, "no brokers, 1 topic with offline replica V5", &response, noBrokersOneTopicWithOfflineReplicasV5, 5)
347 if response.ThrottleTimeMs != int32(5) {
348 t.Error("Decoding produced", response.ThrottleTimeMs, "should have been 5!")
349 }
350 if len(response.Brokers) != 0 {
351 t.Error("Decoding produced", response.Brokers, "should have been 0!")
352 }
353 if response.ControllerID != int32(2) {
354 t.Error("Decoding produced", response.ControllerID, "should have been 21!")
355 }
356 if *response.ClusterID != "clusterId" {
357 t.Error("Decoding produced", response.ClusterID, "should have been clusterId!")
358 }
359 if len(response.Topics) != 1 {
360 t.Error("Decoding produced", len(response.Topics), "should have been 1!")
361 }
362 if len(response.Topics[0].Partitions[0].OfflineReplicas) != 1 {
363 t.Error("Decoding produced", len(response.Topics[0].Partitions[0].OfflineReplicas), "should have been 1!")
364 }
365}
366
367func TestMetadataResponseV6(t *testing.T) {
368 response := MetadataResponse{}

Callers

nothing calls this directly

Calls 2

testVersionDecodableFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected