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

Function TestMetadataResponseWithThrottleTime

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

Source from the content-addressed store, hash-verified

320}
321
322func TestMetadataResponseWithThrottleTime(t *testing.T) {
323 response := MetadataResponse{}
324
325 testVersionDecodable(t, "no topics, no brokers, throttle time and cluster Id V3", &response, noBrokersNoTopicsWithThrottleTimeAndClusterIDV3, 3)
326 if response.ThrottleTimeMs != int32(16) {
327 t.Error("Decoding produced", response.ThrottleTimeMs, "should have been 16!")
328 }
329 if len(response.Brokers) != 0 {
330 t.Error("Decoding produced", response.Brokers, "should have been 0!")
331 }
332 if response.ControllerID != int32(1) {
333 t.Error("Decoding produced", response.ControllerID, "should have been 1!")
334 }
335 if *response.ClusterID != "clusterId" {
336 t.Error("Decoding produced", response.ClusterID, "should have been clusterId!")
337 }
338 if len(response.Topics) != 0 {
339 t.Error("Decoding produced", len(response.Topics), "should have been 0!")
340 }
341}
342
343func TestMetadataResponseWithOfflineReplicasV5(t *testing.T) {
344 response := MetadataResponse{}

Callers

nothing calls this directly

Calls 2

testVersionDecodableFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected