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

Function TestMetadataResponseWithTopicsV1

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

Source from the content-addressed store, hash-verified

299}
300
301func TestMetadataResponseWithTopicsV1(t *testing.T) {
302 response := MetadataResponse{}
303
304 testVersionDecodable(t, "topics, V1", &response, topicsNoBrokersMetadataResponseV1, 1)
305 if len(response.Brokers) != 0 {
306 t.Error("Decoding produced", len(response.Brokers), "brokers where there were none!")
307 }
308 if response.ControllerID != 4 {
309 t.Error("Decoding produced", response.ControllerID, "should have been 4!")
310 }
311 if len(response.Topics) != 2 {
312 t.Error("Decoding produced", len(response.Topics), "topics where there were 2!")
313 }
314 if response.Topics[0].IsInternal {
315 t.Error("Decoding produced", response.Topics[0], "topic0 should have been false!")
316 }
317 if !response.Topics[1].IsInternal {
318 t.Error("Decoding produced", response.Topics[1], "topic1 should have been true!")
319 }
320}
321
322func TestMetadataResponseWithThrottleTime(t *testing.T) {
323 response := MetadataResponse{}

Callers

nothing calls this directly

Calls 2

testVersionDecodableFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected