(t *testing.T)
| 365 | } |
| 366 | |
| 367 | func 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 | |
| 394 | func TestMetadataResponseV7(t *testing.T) { |
| 395 | response := MetadataResponse{} |
nothing calls this directly
no test coverage detected