(t *testing.T)
| 341 | } |
| 342 | |
| 343 | func 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 | |
| 367 | func TestMetadataResponseV6(t *testing.T) { |
| 368 | response := MetadataResponse{} |
nothing calls this directly
no test coverage detected