(t *testing.T)
| 190 | } |
| 191 | |
| 192 | func TestMetadataResponseWithBrokersV0(t *testing.T) { |
| 193 | response := MetadataResponse{} |
| 194 | |
| 195 | testVersionDecodable(t, "brokers, no topics, V0", &response, brokersNoTopicsMetadataResponseV0, 0) |
| 196 | if len(response.Brokers) != 2 { |
| 197 | t.Fatal("Decoding produced", len(response.Brokers), "brokers where there were two!") |
| 198 | } |
| 199 | |
| 200 | if response.Brokers[0].id != 0xabff { |
| 201 | t.Error("Decoding produced invalid broker 0 id.") |
| 202 | } |
| 203 | if response.Brokers[0].addr != "localhost:51" { |
| 204 | t.Error("Decoding produced invalid broker 0 address.") |
| 205 | } |
| 206 | if response.Brokers[1].id != 0x010203 { |
| 207 | t.Error("Decoding produced invalid broker 1 id.") |
| 208 | } |
| 209 | if response.Brokers[1].addr != "google.com:273" { |
| 210 | t.Error("Decoding produced invalid broker 1 address.") |
| 211 | } |
| 212 | |
| 213 | if len(response.Topics) != 0 { |
| 214 | t.Error("Decoding produced", len(response.Topics), "topics where there were none!") |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | func TestMetadataResponseWithTopicsV0(t *testing.T) { |
| 219 | response := MetadataResponse{} |
nothing calls this directly
no test coverage detected